1. 26 8月, 2011 1 次提交
    • C
      block: explicit I/O accounting · a597e79c
      Christoph Hellwig 提交于
      Decouple the I/O accounting from bdrv_aio_readv/writev/flush and
      make the hardware models call directly into the accounting helpers.
      
      This means:
       - we do not count internal requests from image formats in addition
         to guest originating I/O
       - we do not double count I/O ops if the device model handles it
         chunk wise
       - we only account I/O once it actuall is done
       - can extent I/O accounting to synchronous or coroutine I/O easily
       - implement I/O latency tracking easily (see the next patch)
      
      I've conveted the existing device model callers to the new model,
      device models that are using synchronous I/O and weren't accounted
      before haven't been updated yet.  Also scsi hasn't been converted
      to the end-to-end accounting as I want to defer that after the pending
      scsi layer overhaul.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      a597e79c
  2. 23 8月, 2011 3 次提交
  3. 22 8月, 2011 1 次提交
  4. 21 8月, 2011 1 次提交
  5. 04 8月, 2011 1 次提交
  6. 02 8月, 2011 4 次提交
    • K
      async: Remove AsyncContext · 384acbf4
      Kevin Wolf 提交于
      The purpose of AsyncContexts was to protect qcow and qcow2 against reentrancy
      during an emulated bdrv_read/write (which includes a qemu_aio_wait() call and
      can run AIO callbacks of different requests if it weren't for AsyncContexts).
      
      Now both qcow and qcow2 are protected by CoMutexes and AsyncContexts can be
      removed.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      384acbf4
    • K
      block: Add bdrv_co_readv/writev emulation · f9f05dc5
      Kevin Wolf 提交于
      In order to be able to call bdrv_co_readv/writev for drivers that don't
      implement the functions natively, add an emulation that uses the AIO functions
      to implement them.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f9f05dc5
    • K
      block: Emulate AIO functions with bdrv_co_readv/writev · 68485420
      Kevin Wolf 提交于
      Use the bdrv_co_readv/writev callbacks to implement bdrv_aio_readv/writev and
      bdrv_read/write if a driver provides the coroutine version instead of the
      synchronous or AIO version.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      68485420
    • K
      block: Add bdrv_co_readv/writev · da1fa91d
      Kevin Wolf 提交于
      Add new block driver callbacks bdrv_co_readv/writev, which work on a
      QEMUIOVector like bdrv_aio_*, but don't need a callback. The function may only
      be called inside a coroutine, so a block driver implementing this interface can
      yield instead of blocking during I/O.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      da1fa91d
  7. 01 8月, 2011 4 次提交
  8. 19 7月, 2011 1 次提交
  9. 08 6月, 2011 2 次提交
  10. 19 5月, 2011 2 次提交
    • M
      block: Remove type hint, it's guest matter, doesn't belong here · 8d278467
      Markus Armbruster 提交于
      No users of bdrv_get_type_hint() left.  bdrv_set_type_hint() can make
      the media removable by side effect.  Make that explicit.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8d278467
    • M
      block QMP: Deprecate query-block's "type", drop info block's "type=" · d8aeeb31
      Markus Armbruster 提交于
      query-block's specification documents response member "type" with
      values "hd", "cdrom", "floppy", "unknown".
      
      Its value is unreliable: a block device used as floppy has type
      "floppy" if created with if=floppy, but type "hd" if created with
      if=none.
      
      That's because with if=none, the type is at best a declaration of
      intent: the drive can be connected to any guest device.  Its type is
      really the guest device's business.  Reporting it here is wrong.
      
      No known user of QMP uses "type".  It's unlikely that any unknown
      users exist, because its value is useless unless you know how the
      block device was created.  But then you also know the true value.
      
      Fixing the broken value risks breaking (hypothetical!) clients that
      somehow rely on the current behavior.  Not fixing the value risks
      breaking (hypothetical!) clients that rely on the value to be
      accurate.  Can't entirely avoid hypothetical lossage.  Change the
      value to be always "unknown".
      
      This makes "info block" always report "type=unknown".  Pointless.
      Change it to not report the type.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d8aeeb31
  11. 08 5月, 2011 1 次提交
  12. 06 5月, 2011 1 次提交
  13. 07 4月, 2011 3 次提交
    • S
      block: Do not cache device size for removable media · 46a4e4e6
      Stefan Hajnoczi 提交于
      The block layer caches the device size to avoid doing lseek(fd, 0,
      SEEK_END) every time this value is needed.  For removable media the
      device size becomes stale if a new medium is inserted.  This patch
      simply prevents device size caching for removable media.
      
      A smarter solution is to update the cached device size when a new medium
      is inserted.  Given that there are currently bugs with CD-ROM media
      change I do not want to implement that approach until we've gotten
      things correct first.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      46a4e4e6
    • S
      trace: Trace bdrv_set_locked() · b8c6d095
      Stefan Hajnoczi 提交于
      It can be handy to know when the guest locks/unlocks the CD-ROM tray.
      This trace event makes that possible.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b8c6d095
    • R
      Do not delete BlockDriverState when deleting the drive · d22b2f41
      Ryan Harper 提交于
      When removing a drive from the host-side via drive_del we currently have
      the following path:
      
      drive_del
      qemu_aio_flush()
      bdrv_close()    // zaps bs->drv, which makes any subsequent I/O get
                      // dropped.  Works as designed
      drive_uninit()
      bdrv_delete()   // frees the bs.  Since the device is still connected to
                      // bs, any subsequent I/O is a use-after-free.
      
      The value of bs->drv becomes unpredictable on free.  As long as it
      remains null, I/O still gets dropped, however it could become non-null
      at any point after the free resulting SEGVs or other QEMU state
      corruption.
      
      To resolve this issue as simply as possible, we can chose to not
      actually delete the BlockDriverState pointer.  Since bdrv_close()
      handles setting the drv pointer to NULL, we just need to remove the
      BlockDriverState from the QLIST that is used to enumerate the block
      devices.  This is currently handled within bdrv_delete, so move this
      into its own function, bdrv_make_anon().
      
      The result is that we can now invoke drive_del, this closes the file
      descriptors and sets BlockDriverState->drv to NULL which prevents futher
      IO to the device, and since we do not free BlockDriverState, we don't
      have to worry about the copy retained in the block devices.
      
      We also don't attempt to remove the qdev property since we are no longer
      deleting the BlockDriverState on drives with associated drives.  This
      also allows for removing Drives with no devices associated either.
      Reported-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NRyan Harper <ryanh@us.ibm.com>
      Acked-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d22b2f41
  14. 15 3月, 2011 1 次提交
  15. 07 3月, 2011 1 次提交
  16. 20 2月, 2011 1 次提交
  17. 07 2月, 2011 2 次提交
  18. 31 1月, 2011 1 次提交
  19. 24 1月, 2011 1 次提交
  20. 07 1月, 2011 1 次提交
  21. 17 12月, 2010 6 次提交
  22. 14 12月, 2010 1 次提交