Skip to content
Snippets Groups Projects
  1. May 02, 2021
  2. May 01, 2021
  3. Apr 30, 2021
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-04-30' into staging · 8f860d26
      Peter Maydell authored
      
      QAPI patches patches for 2021-04-30
      
      # gpg: Signature made Fri 30 Apr 2021 12:42:32 BST
      # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
      # gpg:                issuer "armbru@redhat.com"
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
      # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
      
      * remotes/armbru/tags/pull-qapi-2021-04-30: (25 commits)
        qapi/error.py: enable mypy checks
        qapi/error: Add type hints
        qapi/error.py: enable pylint checks
        qapi/error.py: move QAPIParseError to parser.py
        qapi/error: assert QAPISourceInfo is not None
        qapi/error: Make QAPISourceError 'col' parameter optional
        qapi/error: Use Python3-style super()
        qapi/error: Repurpose QAPIError as an abstract base exception class
        qapi/expr: Update authorship and copyright information
        qapi/expr.py: Use tuples instead of lists for static data
        qapi/expr.py: Add docstrings
        qapi/expr: Only explicitly prohibit 'Kind' nor 'List' for type names
        qapi/expr.py: enable pylint checks
        qapi/expr.py: Remove single-letter variable
        qapi/expr.py: Consolidate check_if_str calls in check_if
        qapi/expr.py: add type hint annotations
        qapi/expr.py: Modify check_keys to accept any Collection
        qapi/expr.py: Add casts in a few select cases
        qapi/expr.py: Check type of union and alternate 'data' member
        qapi/expr.py: move string check upwards in check_type
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      8f860d26
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging · f38d1ea4
      Peter Maydell authored
      
      Block layer patches
      
      - Fix permission update order problems with block graph changes
      - qemu-img convert: Unshare write permission for source
      - vhost-user-blk: Fail gracefully on too large queue size
      
      # gpg: Signature made Fri 30 Apr 2021 11:27:51 BST
      # gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
      # gpg:                issuer "kwolf@redhat.com"
      # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
      # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
      
      * remotes/kevin/tags/for-upstream: (39 commits)
        vhost-user-blk: Fail gracefully on too large queue size
        qemu-img convert: Unshare write permission for source
        block: Add BDRV_O_NO_SHARE for blk_new_open()
        block: refactor bdrv_node_check_perm()
        block: rename bdrv_replace_child_safe() to bdrv_replace_child()
        block: refactor bdrv_child_set_perm_safe() transaction action
        block: inline bdrv_replace_child()
        block: inline bdrv_check_perm_common()
        block: drop unused permission update functions
        block: bdrv_reopen_multiple: refresh permissions on updated graph
        block: bdrv_reopen_multiple(): move bdrv_flush to separate pre-prepare
        block: add bdrv_set_backing_noperm() transaction action
        block: make bdrv_refresh_limits() to be a transaction action
        block: make bdrv_unset_inherits_from to be a transaction action
        block: drop ignore_children for permission update functions
        block/backup-top: drop .active
        block: introduce bdrv_drop_filter()
        block: add bdrv_remove_filter_or_cow transaction action
        block: adapt bdrv_append() for inserting filters
        block: split out bdrv_replace_node_noperm()
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      f38d1ea4
    • John Snow's avatar
      qapi/error.py: enable mypy checks · b54626e0
      John Snow authored
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      
      Message-Id: <20210421192233.3542904-9-jsnow@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      b54626e0
    • John Snow's avatar
      qapi/error: Add type hints · 30d0a016
      John Snow authored
      
      No functional change.
      
      Note: QAPISourceError's info parameter is Optional[] because schema.py
      treats the info property of its various classes as Optional to
      accommodate built-in types, which have no source. See prior commit
      'qapi/error: assert QAPISourceInfo is not None'.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      
      Message-Id: <20210421192233.3542904-8-jsnow@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      30d0a016
    • John Snow's avatar
      qapi/error.py: enable pylint checks · 92870cf3
      John Snow authored
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20210421192233.3542904-7-jsnow@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      92870cf3
    • John Snow's avatar
      qapi/error.py: move QAPIParseError to parser.py · ac6a7d88
      John Snow authored
      
      Keeping it in error.py will create some cyclic import problems when we
      add types to the QAPISchemaParser. Callers don't need to know the
      details of QAPIParseError unless they are parsing or dealing directly
      with the parser, so this won't create any harsh new requirements for
      callers in the general case.
      
      Update error.py with a little docstring that gives a nod to where the
      error may now be found.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20210421192233.3542904-6-jsnow@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      ac6a7d88
    • John Snow's avatar
      qapi/error: assert QAPISourceInfo is not None · ac897611
      John Snow authored
      
      Built-in stuff is not parsed from a source file, and therefore have no
      QAPISourceInfo. If such None info was used for reporting an error,
      built-in stuff would be broken. Programming error. Instead of reporting
      a confusing error with bogus source location then, we better crash.
      
      We currently crash only if self.col was set. Assert that self.info is
      not None in order to crash reliably.
      
      We can not yet change the type of the initializer to prove this cannot
      happen at static analysis time before the remainder of the code is fully
      typed.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20210421192233.3542904-5-jsnow@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      ac897611
    • John Snow's avatar
      qapi/error: Make QAPISourceError 'col' parameter optional · 86cc2ff6
      John Snow authored
      
      It's already treated as optional, with one direct caller and some
      subclass callers passing 'None'. Make it officially optional, which
      requires moving the position of the argument to come after all required
      parameters.
      
      QAPISemError becomes functionally identical to QAPISourceError. Keep the
      name to preserve its semantic meaning and avoid code churn, but remove
      the now-useless __init__ wrapper.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20210421192233.3542904-4-jsnow@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      86cc2ff6
    • John Snow's avatar
      qapi/error: Use Python3-style super() · b54e07cc
      John Snow authored
      
      Missed in commit 2cae67bc "qapi: Use super() now we have Python 3".
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20210421192233.3542904-3-jsnow@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      b54e07cc
    • John Snow's avatar
      qapi/error: Repurpose QAPIError as an abstract base exception class · 46f49468
      John Snow authored
      
      Rename QAPIError to QAPISourceError, and then create a new QAPIError
      class that serves as the basis for all of our other custom exceptions,
      without specifying any class properties.
      
      This leaves QAPIError as a package-wide error class that's suitable for
      any current or future errors.
      
      (Right now, we don't have any errors that DON'T also want to specify a
      Source location, but this MAY change. In these cases, a common abstract
      ancestor would be desired.)
      
      Add docstrings to explain the intended function of each error class.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20210421192233.3542904-2-jsnow@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      46f49468
    • John Snow's avatar
      qapi/expr: Update authorship and copyright information · e81718c6
      John Snow authored
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20210421182032.3521476-18-jsnow@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      e81718c6
Loading