1. 27 4月, 2017 1 次提交
  2. 25 4月, 2017 6 次提交
  3. 24 4月, 2017 1 次提交
  4. 11 4月, 2017 3 次提交
  5. 07 4月, 2017 1 次提交
  6. 03 4月, 2017 1 次提交
    • 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
  7. 17 3月, 2017 3 次提交
    • P
      block: quiesce AioContext when detaching from it · c2b6428d
      Paolo Bonzini 提交于
      While it is true that bdrv_set_aio_context only works on a single
      BlockDriverState subtree (see commit message for 53ec73e2, "block: Use
      bdrv_drain to replace uncessary bdrv_drain_all", 2015-07-07), it works
      at the AioContext level rather than the BlockDriverState level.
      
      Therefore, it is also necessary to trigger pending bottom halves too,
      even if no requests are pending.
      
      For NBD this ensures that the aio_co_schedule of a previous call to
      nbd_attach_aio_context is completed before detaching from the old
      AioContext; it fixes qemu-iotest 094.  Another similar bug happens
      when the VM is stopped and the virtio-blk dataplane irqfd is torn down.
      In this case it's possible that guest I/O gets stuck if notify_guest_bh
      was scheduled but doesn't run.
      
      Calling aio_poll from another AioContext is safe if non-blocking; races
      such as the one mentioned in the commit message for c9d1a561 ("block:
      only call aio_poll on the current thread's AioContext", 2016-10-28)
      are a concern for blocking calls.
      
      I considered other options, including:
      
      - moving the bs->wakeup mechanism to AioContext, and letting the caller
      check.  This might work for virtio which has a clear place to wakeup
      (notify_place_bh) and check the condition (virtio_blk_data_plane_stop).
      For aio_co_schedule I couldn't find a clear place to check the condition.
      
      - adding a dummy oneshot bottom half and waiting for it to trigger.
      This has the complication that bottom half list is LIFO for historical
      reasons.  There were performance issues caused by bottom half ordering
      in the past, so I decided against it for 2.9.
      
      Fixes: 99723548Reported-by: NMax Reitz <mreitz@redhat.com>
      Reported-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
      Tested-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 20170314111157.14464-2-pbonzini@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      c2b6428d
    • F
      block: Propagate error in bdrv_open_backing_file · 8cd1a3e4
      Fam Zheng 提交于
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8cd1a3e4
    • F
      block: Always call bdrv_child_check_perm first · c1cef672
      Fam Zheng 提交于
      bdrv_child_set_perm alone is not very usable because the caller must
      call bdrv_child_check_perm first. This is already encapsulated
      conveniently in bdrv_child_try_set_perm, so remove the other prototypes
      from the header and fix the one wrong caller, block/mirror.c.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      c1cef672
  8. 13 3月, 2017 2 次提交
  9. 07 3月, 2017 7 次提交
  10. 01 3月, 2017 15 次提交