[libvirt] [PATCH 1/2] qemu: attempt to delete disk when SCSI attach failed

Peter Krempa pkrempa at redhat.com
Fri Jul 22 11:42:44 UTC 2016


On Fri, Jul 22, 2016 at 12:08:45 +0200, Guido Günther wrote:
> We have a qemuMonitorDriveDel now so use it
> ---
>  src/qemu/qemu_hotplug.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index e8a30d5..6232a0e 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c
> @@ -678,11 +678,12 @@ qemuDomainAttachSCSIDisk(virConnectPtr conn,
>      return ret;
>  
>   exit_monitor:
> -    /* XXX should call 'drive_del' on error but this does not exist yet */
> -    if (driveAdded)
> -        VIR_WARN("qemuMonitorAddDevice failed on %s (%s)", drivestr, devstr);
> -
>      orig_err = virSaveLastError();
> +    if (driveAdded && qemuMonitorDriveDel(priv->mon, drivestr) < 0) {

This won't work. You need to delete the drive by alias.

See commit 64c6695f1ad72f0a99faace5deb1caf7effa2275




More information about the libvir-list mailing list