1. 07 4月, 2017 13 次提交
  2. 06 4月, 2017 1 次提交
  3. 05 4月, 2017 6 次提交
    • P
      tco: do not generate an NMI · 8c9f42f3
      Paolo Bonzini 提交于
      This behavior is not indicated in the datasheet and can confuse the OS.
      The TCO can trap NMIs from SERR# or IOCHK# and convert them to SMIs; but
      any other TCO event is either delivered as an SMI or completely disabled.
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      8c9f42f3
    • P
      Update version for v2.9.0-rc3 release · 1fde6ee8
      Peter Maydell 提交于
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      1fde6ee8
    • P
      Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging · 1413c663
      Peter Maydell 提交于
      Some 9pfs bugs fixes: potential hang at reset, migration blocker leak.
      
      # gpg: Signature made Tue 04 Apr 2017 17:07:55 BST
      # gpg:                using DSA key 0x02FC3AEB0101DBC2
      # gpg: Good signature from "Greg Kurz <groug@kaod.org>"
      # gpg:                 aka "Greg Kurz <groug@free.fr>"
      # gpg:                 aka "Greg Kurz <gkurz@linux.vnet.ibm.com>"
      # gpg:                 aka "Gregory Kurz (Groug) <groug@free.fr>"
      # gpg:                 aka "[jpeg image of size 3330]"
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: 2BD4 3B44 535E C0A7 9894  DBA2 02FC 3AEB 0101 DBC2
      
      * remotes/gkurz/tags/for-upstream:
        9pfs: clear migration blocker at session reset
        9pfs: fix multiple flush for same request
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      1413c663
    • P
      Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging · 2c9938c5
      Peter Maydell 提交于
      pci: fix
      
      A single bugfix for a error handling issue in pci.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      
      # gpg: Signature made Tue 04 Apr 2017 16:33:04 BST
      # gpg:                using RSA key 0x281F0DB8D28D5469
      # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
      # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
      # 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:
        pci: Only unmap bus_master_enabled_region if was added previously
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      2c9938c5
    • G
      9pfs: clear migration blocker at session reset · 6d54af0e
      Greg Kurz 提交于
      The migration blocker survives a device reset: if the guest mounts a 9p
      share and then gets rebooted with system_reset, it will be unmigratable
      until it remounts and umounts the 9p share again.
      
      This happens because the migration blocker is supposed to be cleared when
      we put the last reference on the root fid, but virtfs_reset() wrongly calls
      free_fid() instead of put_fid().
      
      This patch fixes virtfs_reset() so that it honor the way fids are supposed
      to be manipulated: first get a reference and later put it back when you're
      done.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NLi Qiang <liqiang6-s@360.cn>
      6d54af0e
    • G
      9pfs: fix multiple flush for same request · 18adde86
      Greg Kurz 提交于
      If a client tries to flush the same outstanding request several times, only
      the first flush completes. Subsequent ones keep waiting for the request
      completion in v9fs_flush() and, therefore, leak a PDU. This will cause QEMU
      to hang when draining active PDUs the next time the device is reset.
      
      Let have each flush request wake up the next one if any. The last waiter
      frees the cancelled PDU.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      18adde86
  4. 04 4月, 2017 7 次提交
  5. 03 4月, 2017 13 次提交
    • P
      Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2017-04-03' into staging · b1a419ec
      Peter Maydell 提交于
      Block patches for 2.9-rc3
      
      # gpg: Signature made Mon 03 Apr 2017 16:29:49 BST
      # gpg:                using RSA key 0xF407DB0061D5CF40
      # gpg: Good signature from "Max Reitz <mreitz@redhat.com>"
      # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
      
      * remotes/maxreitz/tags/pull-block-2017-04-03:
        block/parallels: Avoid overflows
        iotests: Improve image-clear tests on non-aligned image
        qcow2: Discard unaligned tail when wiping image
        iotests: fix 097 when run with qcow
        qemu-io-cmds: Assert that global and nofile commands don't use ct->perms
        sheepdog: Fix blockdev-add
        nbd: Tidy up blockdev-add interface
        sockets: New helper socket_address_crumple()
        qapi-schema: SocketAddressFlat variants 'vsock' and 'fd'
        gluster: Prepare for SocketAddressFlat extension
        block: Document -drive problematic code and bugs
        io vnc sockets: Clean up SocketAddressKind switches
        char: Fix socket with "type": "vsock" address
        nbd sockets vnc: Mark problematic address family tests TODO
        block: add missed aio_context_acquire into release_drive
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      b1a419ec
    • M
      block/parallels: Avoid overflows · 86d1bd70
      Max Reitz 提交于
      Change the types of variables in allocate_clusters() to int64_t so we do
      not have to worry about potential overflows.
      
      Add an assertion that our accesses to s->bat[] do not result in a buffer
      overflow and that the implicit conversion performed when invoking
      bat_entry_off() does not result in an integer overflow.
      
      Coverity-id: 1307776
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20170331170512.10381-1-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      86d1bd70
    • E
      iotests: Improve image-clear tests on non-aligned image · f82c5b17
      Eric Blake 提交于
      Tweak 097 and 176 to operate on an image that is not cluster-aligned,
      to give further coverage of clearing out an entire image, including
      the recent fix to eliminate the difference between fast path (97) and
      slow (176) for qcow2.  Also tested on qcow (97 only, since qcow lacks
      snapshots).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-id: 20170331185356.2479-4-eblake@redhat.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      f82c5b17
    • E
      qcow2: Discard unaligned tail when wiping image · 0c1bd469
      Eric Blake 提交于
      There is a subtle difference between the fast (qcow2v3 with no
      extra data) and slow path (qcow2v2 format [aka 0.10], or when a
      snapshot is present) of qcow2_make_empty().  The slow path fails
      to discard the final (partial) cluster of an unaligned image.
      
      The problem stems from the fact that qcow2_discard_clusters() was
      silently ignoring sub-cluster head and tail on unaligned requests.
      A quick audit of all callers shows that qcow2_snapshot_create() has
      always passed a cluster-aligned request since the call was added
      in commit 1ebf561c; qcow2_co_pdiscard() has passed a cluster-aligned
      request since commit ecdbead6 taught the block layer about preferred
      discard alignment; and qcow2_make_empty() was fixed to pass an
      aligned start (but not necessarily end) in commit a3e1505d.
      
      Asserting that the start is always aligned also points out that we
      now have a dead check: rounding the end offset down can never result
      in a value less than the aligned start offset (the check was rendered
      dead with commit ecdbead6).  Meanwhile, we do not want to round the
      end cluster down in the one case of the end offset matching the
      (unaligned) file size - that final partial cluster should still be
      discarded.
      
      With those fixes in place, the fast and slow paths are back in sync
      at discarding an entire image; the next patch will update
      qemu-iotests to ensure we don't regress.
      
      Note that bdrv_co_pdiscard ignores ALL partial cluster requests,
      including the partial cluster at the end of an image; it can be
      argued that the partial cluster at the end should be special-cased
      so that a guest issuing discard requests at proper alignments
      everywhere else can likewise empty the entire image.  But that
      optimization is left for another day.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-id: 20170331185356.2479-3-eblake@redhat.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      0c1bd469
    • D
      iotests: fix 097 when run with qcow · 07ff948b
      Daniel P. Berrange 提交于
      The previous commit:
      
        commit a3e1505d
        Author: Eric Blake <eblake@redhat.com>
        Date:   Mon Dec 5 09:49:34 2016 -0600
      
          qcow2: Don't strand clusters near 2G intervals during commit
      
      extended the 097 test case so that it did two passes, once
      with an internal snapshot, once without.
      
      qcow (v1) does not support internal snapshots, so this change
      broke test 097 when run against qcow.
      
      This splits 097 in two, creating a new 176 that tests the
      internal snapshot codepath, effectively putting 097 back
      to its content before the above commit.
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <20170221115512.21918-8-berrange@redhat.com>
      [eblake: test collisions: s/173/176/g]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-id: 20170331185356.2479-2-eblake@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      07ff948b
    • P
      qemu-io-cmds: Assert that global and nofile commands don't use ct->perms · 6aabeb58
      Peter Maydell 提交于
      It would be a bug for a command with the CMD_NOFILE_OK or
      CMD_FLAG_GLOBAL flags set to also set the ct->perms field,
      because the former says "OK for a file not to be open"
      but the latter is a check on a file.
      
      Add an assertion in qemuio_add_command() so we can catch that
      sort of buggy command definition immediately rather than it
      being a bug that only manifests when a particular set of
      command line options is used.
      
      (Coverity gets confused about this (CID 1371723) and reports
      that we might dereference a NULL blk pointer in this case,
      because it can't tell that that code path never happens with
      the cmdinfo_t that we have. This commit won't help unconfuse
      it, but it does fix the underlying issue.)
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1490967529-4767-1-git-send-email-peter.maydell@linaro.org
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      6aabeb58
    • M
      sheepdog: Fix blockdev-add · d1c13688
      Markus Armbruster 提交于
      Commit 831acdc9 "sheepdog: Implement bdrv_parse_filename()" and commit
      d282f34e "sheepdog: Support blockdev-add" have different ideas on how
      the QemuOpts parameters for the server address are named.  Fix that.
      While there, rename BlockdevOptionsSheepdog member addr to server, for
      consistency with BlockdevOptionsSsh, BlockdevOptionsGluster,
      BlockdevOptionsNbd.
      
      Commit 831acdc9's example becomes
      
          --drive driver=sheepdog,server.type=inet,server.host=fido,server.port=7000,vdi=dolly
      
      instead of
      
          --drive driver=sheepdog,host=fido,vdi=dolly
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Tested-by: NKashyap Chamarthy <kchamart@redhat.com>
      Message-id: 1490895797-29094-10-git-send-email-armbru@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      d1c13688
    • M
      nbd: Tidy up blockdev-add interface · 9445673e
      Markus Armbruster 提交于
      SocketAddress is a simple union, and simple unions are awkward: they
      have their variant members wrapped in a "data" object on the wire, and
      require additional indirections in C.  I intend to limit its use to
      existing external interfaces, and convert all internal interfaces to
      SocketAddressFlat.
      
      BlockdevOptionsNbd is an external interface using SocketAddress.  We
      already use SocketAddressFlat elsewhere in blockdev-add.  Replace it
      by SocketAddressFlat while we can (it's new in 2.9) for simplicity and
      consistency.  For example,
      
          { "execute": "blockdev-add",
            "arguments": { "node-name": "foo", "driver": "nbd",
                           "server": { "type": "inet",
      		                 "data": { "host": "localhost",
      				           "port": "12345" } } } }
      
      becomes
      
          { "execute": "blockdev-add",
            "arguments": { "node-name": "foo", "driver": "nbd",
                           "server": { "type": "inet",
      		                 "host": "localhost", "port": "12345" } } }
      
      Since the internal interfaces still take SocketAddress, this requires
      conversion function socket_address_crumple().  It'll go away when I
      update the interfaces.
      
      Unfortunately, SocketAddress is also visible in -drive since 2.8:
      
          -drive if=none,driver=nbd,server.type=inet,server.data.host=127.0.0.1,server.data.port=12345
      
      Nobody should be using it, as it's fairly new and has never been
      documented, so adding still more compatibility gunk to keep it working
      isn't worth the trouble.  You now have to use
      
          -drive if=none,driver=nbd,server.type=inet,server.host=127.0.0.1,server.port=12345
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-id: 1490895797-29094-9-git-send-email-armbru@redhat.com
      
      [mreitz: Change iotest 147 accordingly]
      
      Because of this interface change, iotest 147 has to be adapted.
      Unfortunately, we cannot just flatten all of the addresses because
      nbd-server-start still takes a plain SocketAddress. Therefore, we need
      both and this is most easily achieved by writing the SocketAddress into
      the code and flattening it where necessary.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20170330221243.17333-1-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      9445673e
    • M
      sockets: New helper socket_address_crumple() · 216411b8
      Markus Armbruster 提交于
      SocketAddress is a simple union, and simple unions are awkward: they
      have their variant members wrapped in a "data" object on the wire, and
      require additional indirections in C.  I intend to limit its use to
      existing external interfaces.  New ones should use SocketAddressFlat.
      I further intend to convert all internal interfaces to
      SocketAddressFlat.  This helper should go away then.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-id: 1490895797-29094-8-git-send-email-armbru@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      216411b8
    • M
      qapi-schema: SocketAddressFlat variants 'vsock' and 'fd' · 8bc0673f
      Markus Armbruster 提交于
      Note that the new variants are impossible in qemu_gluster_glfs_init(),
      because the gconf->server can only come from qemu_gluster_parse_uri()
      or qemu_gluster_parse_json(), and neither can create anything but
      'inet' or 'unix'.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 1490895797-29094-7-git-send-email-armbru@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      8bc0673f
    • M
      gluster: Prepare for SocketAddressFlat extension · fce5d538
      Markus Armbruster 提交于
      qemu_gluster_glfs_init() and qemu_gluster_parse_json() rely on the
      fact that SocketAddressFlatType has only two members
      SOCKET_ADDRESS_FLAT_TYPE_INET and SOCKET_ADDRESS_FLAT_TYPE_UNIX.
      Correct, but won't stay correct.  Make them more robust.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490895797-29094-6-git-send-email-armbru@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      fce5d538
    • M
      block: Document -drive problematic code and bugs · 129c7d1c
      Markus Armbruster 提交于
      -blockdev and blockdev_add convert their arguments via QObject to
      BlockdevOptions for qmp_blockdev_add(), which converts them back to
      QObject, then to a flattened QDict.  The QDict's members are typed
      according to the QAPI schema.
      
      -drive converts its argument via QemuOpts to a (flat) QDict.  This
      QDict's members are all QString.
      
      Thus, the QType of a flat QDict member depends on whether it comes
      from -drive or -blockdev/blockdev_add, except when the QAPI type maps
      to QString, which is the case for 'str' and enumeration types.
      
      The block layer core extracts generic configuration from the flat
      QDict, and the block driver extracts driver-specific configuration.
      
      Both commonly do so by converting (parts of) the flat QDict to
      QemuOpts, which turns all values into strings.  Not exactly elegant,
      but correct.
      
      However, A few places access the flat QDict directly:
      
      * Most of them access members that are always QString.  Correct.
      
      * bdrv_open_inherit() accesses a boolean, carefully.  Correct.
      
      * nfs_config() uses a QObject input visitor.  Correct only because the
        visited type contains nothing but QStrings.
      
      * nbd_config() and ssh_config() use a QObject input visitor, and the
        visited types contain non-QStrings: InetSocketAddress members
        @numeric, @to, @ipv4, @ipv6.  -drive works as long as you don't try
        to use them (they're all optional).  @to is ignored anyway.
      
        Reproducer:
        -drive driver=ssh,server.host=h,server.port=22,server.ipv4,path=p
        -drive driver=nbd,server.type=inet,server.data.host=h,server.data.port=22,server.data.ipv4
        both fail with "Invalid parameter type for 'data.ipv4', expected: boolean"
      
      Add suitable comments to all these places.  Mark the buggy ones FIXME.
      
      "Fortunately", -drive's driver-specific options are entirely
      undocumented.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-id: 1490895797-29094-5-git-send-email-armbru@redhat.com
      [mreitz: Fixed two typos]
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      129c7d1c
    • M
      io vnc sockets: Clean up SocketAddressKind switches · a6c76285
      Markus Armbruster 提交于
      We have quite a few switches over SocketAddressKind.  Some have case
      labels for all enumeration values, others rely on a default label.
      Some abort when the value isn't a valid SocketAddressKind, others
      report an error then.
      
      Unify as follows.  Always provide case labels for all enumeration
      values, to clarify intent.  Abort when the value isn't a valid
      SocketAddressKind, because the program state is messed up then.
      
      Improve a few error messages while there.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 1490895797-29094-4-git-send-email-armbru@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      a6c76285