On 11/16/2010 03:12 AM, Daniel P. Berrange wrote:
On Fri, Nov 12, 2010 at 12:23:41PM -0600, Ryan Harper wrote:
> Currently libvirt doesn't confirm whether the guest has responded to the
> disk removal request. In some cases this can leave the guest with
> continued access to the device while the mgmt layer believes that it has
> been removed. With a recent qemu monitor command[1] we can
> deterministically revoke a guests access to the disk (on the QEMU side)
> to ensure no futher access is permitted.
>
> This patch adds support for the drive_del() command and introduces it
> in the disk removal paths. If the guest is running in a QEMU without this
> command we currently explicitly check for unknown command/CommandNotFound
> and log the issue.
>
> If QEMU supports the command we issue the drive_del command after we attempt
> to remove the device. The guest may respond and remove the block device
> before we get to attempt to call drive_del. In that case, we explicitly check
> for 'Device not found' from the monitor indicating that the target drive
> was auto-deleted upon guest responds to the device removal notification.
>
> 1.
http://thread.gmane.org/gmane.comp.emulators.qemu/84745
>
> Signed-off-by: Ryan Harper <ryanh(a)us.ibm.com>
> ---
> Changes since v4:
> - removed PATH_MAX, use virAsprintf()
> - moved drivestr allocation before call to EnterMonitor
ACK, once this drive_del hits the main QEMU git repos
Shoot. I committed v3 rather than v5 upstream. I'll have to fix that
up; sorry for my mess.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org