1. 27 9月, 2019 4 次提交
  2. 26 9月, 2019 3 次提交
    • P
      Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging · 1329132d
      Peter Maydell 提交于
      vhost: fixes
      
      Misc fixes related to memory region handling.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      
      # gpg: Signature made Wed 25 Sep 2019 15:28:23 BST
      # gpg:                using RSA key 281F0DB8D28D5469
      # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
      # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
      # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
      #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
      
      * remotes/mst/tags/for_upstream:
        vhost: Fix memory region section comparison
        memory: Provide an equality function for MemoryRegionSections
        memory: Align MemoryRegionSections fields
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      1329132d
    • P
      Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20190925a' into staging · eb13d1cf
      Peter Maydell 提交于
      Migration pull 2019-09-25
      
        me: test fixes from (should stop hangs in postcopy tests).
        me: An RDMA cleanup hang fix
        Wei: Tidy ups around postcopy
        Marc-Andre: mem leak fix
      
      # gpg: Signature made Wed 25 Sep 2019 15:59:41 BST
      # gpg:                using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7
      # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full]
      # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A  9FA9 0516 331E BC5B FDE7
      
      * remotes/dgilbert/tags/pull-migration-20190925a:
        migration/postcopy: Recognise the recovery states as 'in_postcopy'
        tests/migration/postcopy: trim migration bandwidth
        tests/migration: Fail on unexpected migration states
        migration/rdma.c: Swap synchronize_rcu for call_rcu
        migration/rdma: Don't moan about disconnects at the end
        migration: remove sent parameter in get_queued_page_not_dirty
        migration/postcopy: unsentmap is not necessary for postcopy
        migration/postcopy: not necessary to do discard when canonicalizing bitmap
        migration: fix vmdesc leak on vmstate_save() error
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      eb13d1cf
    • P
      Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2019-09-24-v2' into staging · d4e536f3
      Peter Maydell 提交于
      nbd patches for 2019-09-24
      
      - Improved error message for plaintext client of encrypted server
      - Fix various assertions when -object iothread is in use
      - Silence a Coverity error for use-after-free on error path
      
      # gpg: Signature made Wed 25 Sep 2019 14:35:52 BST
      # gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
      # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
      # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
      # gpg:                 aka "[jpeg image of size 6874]" [full]
      # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
      
      * remotes/ericb/tags/pull-nbd-2019-09-24-v2:
        util/qemu-sockets: fix keep_alive handling in inet_connect_saddr
        tests: Use iothreads during iotest 223
        nbd: Grab aio context lock in more places
        nbd/server: attach client channel to the export's AioContext
        nbd/client: Add hint when TLS is missing
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      d4e536f3
  3. 25 9月, 2019 14 次提交
  4. 24 9月, 2019 19 次提交
    • P
      Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190924' into staging · 240ab11f
      Peter Maydell 提交于
      Xen queue
      
      * Update of maintainer email address
      * Fixes for xen-bus and xen-block
      
      # gpg: Signature made Tue 24 Sep 2019 12:27:56 BST
      # gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
      # gpg:                issuer "anthony.perard@citrix.com"
      # gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [marginal]
      # gpg:                 aka "Anthony PERARD <anthony.perard@citrix.com>" [marginal]
      # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
      # gpg:          It is not certain that the signature belongs to the owner.
      # Primary key fingerprint: 5379 2F71 024C 600F 778A  7161 D8D5 7199 DF83 42C8
      #      Subkey fingerprint: F80C 0063 08E2 2CFD 8A92  E798 0CF5 572F D7FB 55AF
      
      * remotes/aperard/tags/pull-xen-20190924:
        xen-bus: only set the xen device frontend state if it is missing
        xen-block: treat XenbusStateUnknown the same as XenbusStateClosed
        MAINTAINERS: update my email address
        xen: perform XenDevice clean-up in XenBus watch handler
        xen: introduce separate XenWatchList for XenDevice objects
        xen / notify: introduce a new XenWatchList abstraction
        xen-bus: check whether the frontend is active during device reset...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      240ab11f
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/audio-20190924-pull-request' into staging · 860d9048
      Peter Maydell 提交于
      audio: documentation fixes.
      audio: new backend api (first part of the surround sound patch series).
      
      # gpg: Signature made Tue 24 Sep 2019 07:19:31 BST
      # gpg:                using RSA key 4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * remotes/kraxel/tags/audio-20190924-pull-request:
        audio: split ctl_* functions into enable_* and volume_*
        audio: common rate control code for timer based outputs
        audio: unify input and output mixeng buffer management
        audio: remove remains of the old backend api
        wavaudio: port to the new audio backend api
        spiceaudio: port to the new audio backend api
        sdlaudio: port to the new audio backend api
        paaudio: port to the new audio backend api
        ossaudio: port to the new audio backend api
        noaudio: port to the new audio backend api
        dsoundaudio: port to the new audio backend api
        coreaudio: port to the new audio backend api
        alsaaudio: port to the new audio backend api
        audio: api for mixeng code free backends
        audio: fix ALSA period-length typo in documentation
        audio: fix buffer-length typo in documentation
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      860d9048
    • E
      tests: Use iothreads during iotest 223 · 506902c6
      Eric Blake 提交于
      Doing so catches the bugs we just fixed with NBD not properly using
      correct contexts.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20190920220729.31801-1-eblake@redhat.com>
      506902c6
    • E
      nbd: Grab aio context lock in more places · 61bc846d
      Eric Blake 提交于
      When iothreads are in use, the failure to grab the aio context results
      in an assertion failure when trying to unlock things during blk_unref,
      when trying to unlock a mutex that was not locked.  In short, all
      calls to nbd_export_put need to done while within the correct aio
      context.  But since nbd_export_put can recursively reach itself via
      nbd_export_close, and recursively grabbing the context would deadlock,
      we can't do the context grab directly in those functions, but must do
      so in their callers.
      
      Hoist the use of the correct aio_context from nbd_export_new() to its
      caller qmp_nbd_server_add().  Then tweak qmp_nbd_server_remove(),
      nbd_eject_notifier(), and nbd_esport_close_all() to grab the right
      context, so that all callers during qemu now own the context before
      nbd_export_put() can call blk_unref().
      
      Remaining uses in qemu-nbd don't matter (since that use case does not
      support iothreads).
      Suggested-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20190917023917.32226-1-eblake@redhat.com>
      Reviewed-by: NSergio Lopez <slp@redhat.com>
      61bc846d
    • S
      nbd/server: attach client channel to the export's AioContext · b4961249
      Sergio Lopez 提交于
      On creation, the export's AioContext is set to the same one as the
      BlockBackend, while the AioContext in the client QIOChannel is left
      untouched.
      
      As a result, when using data-plane, nbd_client_receive_next_request()
      schedules coroutines in the IOThread AioContext, while the client's
      QIOChannel is serviced from the main_loop, potentially triggering the
      assertion at qio_channel_restart_[read|write].
      
      To fix this, as soon we have the export corresponding to the client,
      we call qio_channel_attach_aio_context() to attach the QIOChannel
      context to the export's AioContext. This matches with the logic at
      blk_aio_attached().
      
      RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1748253Signed-off-by: NSergio Lopez <slp@redhat.com>
      Message-Id: <20190912110032.26395-1-slp@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b4961249
    • E
      nbd/client: Add hint when TLS is missing · 1b5c15ce
      Eric Blake 提交于
      I received an off-list report of failure to connect to an NBD server
      expecting an x509 certificate, when the client was attempting something
      similar to this command line:
      
      $ ./x86_64-softmmu/qemu-system-x86_64 -name 'blah' -machine q35 -nodefaults \
        -object tls-creds-x509,id=tls0,endpoint=client,dir=$path_to_certs \
        -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie.0,addr=0x6 \
        -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=raw,file=nbd:localhost:9000,werror=stop,rerror=stop,tls-creds=tls0 \
        -device scsi-hd,id=image1,drive=drive_image1,bootindex=0
      qemu-system-x86_64: -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=raw,file=nbd:localhost:9000,werror=stop,rerror=stop,tls-creds=tls0: TLS negotiation required before option 7 (go)
      server reported: Option 0x7 not permitted before TLS
      
      The problem?  As specified, -drive is trying to pass tls-creds to the
      raw format driver instead of the nbd protocol driver, but before we
      get to the point where we can detect that raw doesn't know what to do
      with tls-creds, the nbd driver has already failed because the server
      complained.  The fix to the broken command line?  Pass
      '...,file.tls-creds=tls0' to ensure the tls-creds option is handed to
      nbd, not raw.  But since the error message was rather cryptic, I'm
      trying to improve the error message.
      
      With this patch, the error message adds a line:
      
      qemu-system-x86_64: -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=raw,file=nbd:localhost:9000,werror=stop,rerror=stop,tls-creds=tls0: TLS negotiation required before option 7 (go)
      Did you forget a valid tls-creds?
      server reported: Option 0x7 not permitted before TLS
      
      And with luck, someone grepping for that error message will find this
      commit message and figure out their command line mistake.  Sadly, the
      only mention of file.tls-creds in our docs relates to an --image-opts
      use of PSK encryption with qemu-img as the client, rather than x509
      certificate encryption with qemu-kvm as the client.
      
      CC: Tingting Mao <timao@redhat.com>
      CC: Daniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20190907172055.26870-1-eblake@redhat.com>
      [eblake: squash in iotest 233 fix]
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      1b5c15ce
    • M
      qapi: Assert .visit() and .check_clash() run only after .check() · 56176412
      Markus Armbruster 提交于
      Easy since the previous commit provides .checked.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190914153506.2151-20-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      56176412
    • M
      qapi: Fix excessive QAPISchemaEntity.check() recursion · f9d1743b
      Markus Armbruster 提交于
      Entity checking goes back to commit ac88219a "qapi: New QAPISchema
      intermediate representation", v2.5.0.  It's designed to work as
      follows: QAPISchema.check() calls .check() for all the schema's
      entities.  An entity's .check() recurses into another entity's
      .check() only if the C struct generated for the former contains the C
      struct generated for the latter (pointers don't count).  This is used
      to detect "object contains itself".
      
      There are two instances of this:
      
      * An object's C struct contains its base's C struct
      
        QAPISchemaObjectType.check() calls self.base.check()
      
      * An object's C struct contains its variants' C structs
      
        QAPISchemaObjectTypeVariants().check calls v.type.check().  Since
        commit b807a1e1 "qapi: Check for QAPI collisions involving variant
        members", v2.6.0.
      
      Thus, only object types can participate in recursion.
      
      QAPISchemaObjectType.check() is made for that: it checks @self when
      called the first time, recursing into base and variants, it reports an
      "contains itself" error when this recursion reaches an object being
      checked, and does nothing it reaches an object that has been checked
      already.
      
      The other .check() may safely assume they get called exactly once.
      
      Sadly, this design has since eroded:
      
      * QAPISchemaCommand.check() and QAPISchemaEvent.check() call
        .args_type.check().  Since commit c818408e "qapi: Implement boxed
        types for commands/events", v2.7.0.  Harmless, since args_type can
        only be an object type.
      
      * QAPISchemaEntity.check() calls ._ifcond.check() when inheriting the
        condition from another type.  Since commit 4fca21c1 qapi: leave
        the ifcond attribute undefined until check(), v3.0.0.  This makes
        simple union wrapper types recurse into the wrapped type (nothing
        else uses this condition inheritance).  The .check() of types used
        as simple union branch type get called multiple times.
      
      * QAPISchemaObjectType.check() calls its super type's .check()
        *before* the conditional handling multiple calls.  Also since commit
        4fca21c1.  QAPISchemaObjectType.check()'s guard against multiple
        checking doesn't protect QAPISchemaEntity.check().
      
      * QAPISchemaArrayType.check() calls .element_type.check().  Also since
        commit 4fca21c1.  The .check() of types used as array element
        types get called multiple times.
      
        Commit 56a46895 "qapi: Fix array first used in a different module"
        (v4.0.0) added more code relying on this .element_type.check().
      
      The absence of explosions suggests the .check() involved happen to be
      effectively idempotent.
      
      Fix the unwanted recursion anyway:
      
      * QAPISchemaCommand.check() and QAPISchemaEvent.check() calling
        .args_type.check() is unnecessary.  Delete the calls.
      
      * Fix QAPISchemaObjectType.check() to call its super type's .check()
        after the conditional handling multiple calls.
      
      * A QAPISchemaEntity's .ifcond becomes valid at .check().  This is due
        to arrays and simple unions.
      
        Most types get ifcond and info passed to their constructor.
      
        Array types don't: they get it from their element type, which
        becomes known only in .element_type.check().
      
        The implicit wrapper object types for simple union branches don't:
        they get it from the wrapped type, which might be an array.
      
        Ditch the idea to set .ifcond in .check().  Instead, turn it into a
        property and compute it on demand.  Safe because it's only used
        after the schema has been checked.
      
        Most types simply return the ifcond passed to their constructor.
      
        Array types forward to their .element_type instead, and the wrapper
        types forward to the wrapped type.
      
      * A QAPISchemaEntity's .module becomes valid at .check().  This is
        because computing it needs info and schema.fname, and because array
        types get it from their element type instead.
      
        Make it a property just like .ifcond.
      
      Additionally, have QAPISchemaEntity.check() assert it gets called at
      most once, so the design invariant will stick this time.  Neglecting
      that was entirely my fault.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190914153506.2151-19-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [Commit message tidied up]
      f9d1743b
    • M
      qapi: Fix to .check() empty structs just once · b1bc31f4
      Markus Armbruster 提交于
      QAPISchemaObjectType.check() does nothing for types that have been
      checked already.  Except the "has been checked" predicate is broken
      for empty types: self.members is [] then, which isn't true.  The bug
      is harmless, but fix it anyway: use self.member is not None instead.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190914153506.2151-18-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      b1bc31f4
    • M
      qapi: Delete useless check_exprs() code for simple union kind · e31fe126
      Markus Armbruster 提交于
      Commit bceae769 "qapi script: support enum type as discriminator in
      union" made check_exprs() add the implicit enum types of simple unions
      to global @enum_types.  I'm not sure it was needed even then.  It's
      certainly not needed now.  Delete it.
      
      discriminator_find_enum_define() and add_name() parameter @implicit
      are now dead.  Bury them.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190914153506.2151-17-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      e31fe126
    • M
      qapi: Clean up around check_known_keys() · 69553976
      Markus Armbruster 提交于
      All callers pass a dict argument to @keys, except check_keys() passes
      a dict's .keys().  Drop .keys() there, and rename parameter @keys to
      @value.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190914153506.2151-16-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      69553976
    • M
      qapi: Simplify check_keys() · dc234189
      Markus Armbruster 提交于
      check_keys() parameter expr_elem expects a dictionary with keys 'expr'
      and 'info'.  Passing the two values separately is simpler, so do that.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190914153506.2151-15-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      dc234189
    • M
      qapi: Normalize 'if' in check_exprs(), like other sugar · fe9c4dcf
      Markus Armbruster 提交于
      We normalize shorthand to longhand forms in check_expr(): enumeration
      values with normalize_enum(), feature values with
      normalize_features(), struct members, union branches and alternate
      branches with normalize_members().  If conditions are an exception: we
      normalize them in QAPISchemaEntity.check() and
      QAPISchemaMember.__init(), with listify_cond().  The idea goes back to
      commit 2cbc9437 "qapi: pass 'if' condition into QAPISchemaEntity
      objects", v3.0.0.
      
      Normalize in check_expr() instead, with new helper normalize_if().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190914153506.2151-14-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      fe9c4dcf
    • M
      qapi: Fix missing 'if' checks in struct, union, alternate 'data' · dec0012e
      Markus Armbruster 提交于
      Commit 87adbbff..3e270dca "qapi: Add 'if' to (implicit
      struct|union|alternate) members" (v4.0.0) neglected test coverage, and
      promptly failed to check the conditions.  Review fail.
      
      Recent commit "tests/qapi-schema: Demonstrate insufficient 'if'
      checking" added test coverage, demonstrating the bug.  Fix it by add
      the missing check_if().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190914153506.2151-13-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      dec0012e
    • M
      qapi: Reject blank 'if' conditions in addition to empty ones · c2c7065e
      Markus Armbruster 提交于
      "'if': 'COND'" generates "#if COND".  We reject empty COND because it
      won't compile.  Blank COND won't compile any better, so reject that,
      too.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190914153506.2151-12-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      c2c7065e
    • M
      qapi: Fix broken discriminator error messages · 887a2069
      Markus Armbruster 提交于
      check_union() checks the discriminator exists in base and makes sense.
      Two error messages mention the base.  These are broken for anonymous
      bases, as demonstrated by tests flat-union-invalid-discriminator and
      flat-union-invalid-if-discriminator.err.  The third one doesn't
      bother.
      
      First broken when commit ac4338f8 "qapi: Allow anonymous base for
      flat union" (v2.6.0) neglected to adjust the "not a member of base"
      error message.  Commit ccadd6bc "qapi: Add 'if' to implicit struct
      members" (v4.0.0) then cloned the flawed error message.
      
      Dumb them down not to mention the base.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190914153506.2151-11-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      887a2069
    • M
      qapi: Remove null from schema language · 9d55380b
      Markus Armbruster 提交于
      We represent the parse tree as OrderedDict.  We fetch optional dict
      members with .get().  So far, so good.
      
      We represent null literals as None.  .get() returns None both for
      "absent" and for "present, value is the null literal".  Uh-oh.
      
      Test features-if-invalid exposes this bug: "'if': null" is
      misinterpreted as absent "if".
      
      We added null to the schema language to "allow [...] an explicit
      default value" (commit e53188ad "qapi: Allow true, false and null in
      schema json", v2.4.0).  Hasn't happened; null is still unused except
      as generic invalid value in tests/.
      
      To fix, we'd have to replace .get() by something more careful, or
      represent null differently.  Feasible, but we got more and bigger fish
      to fry right now.  Remove the null literal from the schema language.
      Replace null in tests by another invalid value.
      
      Test features-if-invalid now behaves as it should.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190914153506.2151-10-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      9d55380b
    • M
      qapi: Improve reporting of lexical errors · 14c32795
      Markus Armbruster 提交于
      Show text up to next structural character, whitespace, or quote
      character instead of just the first character.
      
      Forgotten quotes now get reported like "Stray 'command'" instead of
      "Stray 'c'".
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190914153506.2151-9-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      14c32795
    • M
      qapi: Use quotes more consistently in frontend error messages · 9f5e6b08
      Markus Armbruster 提交于
      Consistently enclose error messages in double quotes.  Use single
      quotes within, except for one case of "'".
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190914153506.2151-8-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      9f5e6b08