1. 01 8月, 2011 1 次提交
  2. 22 7月, 2011 1 次提交
  3. 05 7月, 2011 2 次提交
  4. 24 6月, 2011 1 次提交
  5. 08 6月, 2011 1 次提交
  6. 19 5月, 2011 2 次提交
  7. 07 4月, 2011 1 次提交
    • 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
  8. 04 4月, 2011 1 次提交
  9. 15 3月, 2011 1 次提交
    • J
      Improve error handling in do_snapshot_blkdev() · 52f9a172
      Jes Sorensen 提交于
      In case we cannot open the newly created snapshot image, try to fall
      back to the original image file and continue running on that, which
      should prevent the guest from aborting.
      
      This is a corner case which can happen if the admin by mistake
      specifies the snapshot file on a virtual file system which does not
      support O_DIRECT. bdrv_create() does not use O_DIRECT, but the
      following open in bdrv_open() does and will then fail.
      Signed-off-by: NJes Sorensen <Jes.Sorensen@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      52f9a172
  10. 10 2月, 2011 2 次提交
  11. 07 2月, 2011 2 次提交
  12. 31 1月, 2011 10 次提交
  13. 24 1月, 2011 4 次提交
  14. 17 12月, 2010 2 次提交
  15. 25 11月, 2010 1 次提交
    • R
      Implement drive_del to decouple block removal from device removal · 9063f814
      Ryan Harper 提交于
      Currently device hotplug removal code is tied to device removal via
      ACPI.  All pci devices that are removable via device_del() require the
      guest to respond to the request.  In some cases the guest may not
      respond leaving the device still accessible to the guest.  The management
      layer doesn't currently have a reliable way to revoke access to host
      resource in the presence of an uncooperative guest.
      
      This patch implements a new monitor command, drive_del, which
      provides an explicit command to revoke access to a host block device.
      
      drive_del first quiesces the block device (qemu_aio_flush;
      bdrv_flush() and bdrv_close()).  This prevents further IO from being
      submitted against the host device.  Finally, drive_del cleans up
      pointers between the drive object (host resource) and the device
      object (guest resource).
      Signed-off-by: NRyan Harper <ryanh@us.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      9063f814
  16. 04 11月, 2010 1 次提交
  17. 23 8月, 2010 1 次提交
  18. 26 7月, 2010 1 次提交
  19. 06 7月, 2010 1 次提交
  20. 02 7月, 2010 4 次提交