]> git.proxmox.com Git - qemu.git/commit - hmp-commands.hx
Implement drive_del to decouple block removal from device removal
authorRyan Harper <ryanh@us.ibm.com>
Fri, 12 Nov 2010 17:07:13 +0000 (11:07 -0600)
committerKevin Wolf <kwolf@redhat.com>
Wed, 24 Nov 2010 16:30:19 +0000 (17:30 +0100)
commit9063f81415f3518ef8206e74085c2a92c96890a0
treeac5eb775dea385bff21fce6f063eb0348e413217
parent6fa2c95f279dda62aa7e3292cc424ff3fab6a602
Implement drive_del to decouple block removal from device removal

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: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c
blockdev.h
hmp-commands.hx