From: John Ferlan Date: Wed, 8 Oct 2014 21:59:52 +0000 (-0400) Subject: hotplug: Check for alias in disk detach X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=5d02a9a0c5b0d033cf1a68c004bf3cb290666fa8;p=libvirt.git hotplug: Check for alias in disk detach If the QEMU_CAPS_DEVICE is set, then ensure the disk device alias has been properly set in prior to making the calls to detach the device. --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 9c0f6c90ff..3e8cdbfc62 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2998,6 +2998,12 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver, } } + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) && + !detach->info.alias) { + if (qemuAssignDeviceDiskAlias(vm->def, detach, priv->qemuCaps) < 0) + goto cleanup; + } + qemuDomainMarkDeviceForRemoval(vm, &detach->info); qemuDomainObjEnterMonitor(driver, vm);