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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]