[libvirt] [PATCH v2 6/9] qemu: Add attempt to call qemuMonitorDriveDel for AttachSCSI failure path

Ján Tomko jtomko at redhat.com
Mon Aug 1 09:07:14 UTC 2016


On Tue, Jul 19, 2016 at 10:30:49AM -0400, John Ferlan wrote:
>Completion of fix for:
>    https://bugzilla.redhat.com/show_bug.cgi?id=1336225
>
>Similar to the other disk types, add the qemuMonitorDriveDel in the failure
>to add/hotplug a SCSI disk.
>
>Signed-off-by: John Ferlan <jferlan at redhat.com>
>---
> src/qemu/qemu_hotplug.c | 17 ++++++++++++++---
> 1 file changed, 14 insertions(+), 3 deletions(-)
>

>  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, drivealias) < 0) {
>+        VIR_WARN("Unable to remove drive %s (%s) after failed "
>+                 "qemuMonitorAddDevice", drivealias, drivestr);
>+    }


>+    if (orig_err) {
>+        virSetError(orig_err);
>+        virFreeError(orig_err);
>+    }
>
>     orig_err = virSaveLastError();

This can be dropped. The block below also needs to preserve the original error.

Jan

>     if (encobjAdded)
>-- 
>2.5.5
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list




More information about the libvir-list mailing list