[libvirt] [PATCH 0/2] Fix disk hotplug refactoring fallout

https://bugzilla.redhat.com/show_bug.cgi?id=1175668 Ján Tomko (2): Fix hotplugging of block device-backed usb disks Remove redundant cleanup in qemuDomainAttachVirtioDiskDevice src/qemu/qemu_hotplug.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) -- 2.0.4

Commit ca91ba7 moved qemuSetupDiskCgroup into the qemuDomainPrepareDisk helper, but failed to call it for usb disks. https://bugzilla.redhat.com/show_bug.cgi?id=1175668` --- src/qemu/qemu_hotplug.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 21e9713..a8862d9 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -679,16 +679,8 @@ qemuDomainAttachUSBMassstorageDevice(virConnectPtr conn, } } - if (virDomainLockDiskAttach(driver->lockManager, cfg->uri, - vm, disk) < 0) - goto cleanup; - - if (virSecurityManagerSetDiskLabel(driver->securityManager, - vm->def, disk) < 0) { - if (virDomainLockDiskDetach(driver->lockManager, vm, disk) < 0) - VIR_WARN("Unable to release lock on %s", src); + if (qemuDomainPrepareDisk(driver, vm, disk, NULL, false) < 0) goto cleanup; - } /* XXX not correct once we allow attaching a USB CDROM */ if (!src) { @@ -740,13 +732,7 @@ qemuDomainAttachUSBMassstorageDevice(virConnectPtr conn, return ret; error: - if (virSecurityManagerRestoreDiskLabel(driver->securityManager, - vm->def, disk) < 0) - VIR_WARN("Unable to restore security label on %s", src); - - if (virDomainLockDiskDetach(driver->lockManager, vm, disk) < 0) - VIR_WARN("Unable to release lock on %s", src); - + ignore_value(qemuDomainPrepareDisk(driver, vm, disk, NULL, true)); goto cleanup; } -- 2.0.4

Commit ca91ba7 moved these into the qemuDomainPrepareDisk helper, but forgot to remove them from here as well. --- src/qemu/qemu_hotplug.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index a8862d9..7f93b9b 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -411,14 +411,6 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn, qemuDomainReleaseDeviceAddress(vm, &disk->info, src); ignore_value(qemuDomainPrepareDisk(driver, vm, disk, NULL, true)); - - if (virSecurityManagerRestoreDiskLabel(driver->securityManager, - vm->def, disk) < 0) - VIR_WARN("Unable to restore security label on %s", src); - - if (virDomainLockDiskDetach(driver->lockManager, vm, disk) < 0) - VIR_WARN("Unable to release lock on %s", src); - goto cleanup; } -- 2.0.4

On Thu, Dec 18, 2014 at 13:04:44 +0100, Jano Tomko wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1175668
Ján Tomko (2): Fix hotplugging of block device-backed usb disks Remove redundant cleanup in qemuDomainAttachVirtioDiskDevice
src/qemu/qemu_hotplug.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-)
ACK series Jirka
participants (2)
-
Jiri Denemark
-
Ján Tomko