]> xenbits.xensource.com Git - libvirt.git/commitdiff
hotplug: Check for alias in disk detach
authorJohn Ferlan <jferlan@redhat.com>
Wed, 8 Oct 2014 21:59:52 +0000 (17:59 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 29 Oct 2014 01:12:08 +0000 (21:12 -0400)
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.

src/qemu/qemu_hotplug.c

index 9c0f6c90ff2059b245a9bbd48116abd4ded675c8..3e8cdbfc626df88c6d5058cef3aae129c5f4e71f 100644 (file)
@@ -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);