]> xenbits.xensource.com Git - libvirt.git/commitdiff
hotplug: Check for alias in net detach
authorJohn Ferlan <jferlan@redhat.com>
Wed, 8 Oct 2014 22:55:43 +0000 (18:55 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 29 Oct 2014 01:12:08 +0000 (21:12 -0400)
https://bugzilla.redhat.com/show_bug.cgi?id=1141621

If the QEMU_CAPS_DEVICE is set, then ensure the host device alias has
been properly set before making the calls to detach the device

src/qemu/qemu_hotplug.c

index f79a37aeb75baeec9b5bae535dcf01fad4bd629d..33241fb75c8e9ad1366aad7ed0578eb4e67a0e9a 100644 (file)
@@ -3530,6 +3530,12 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
         }
     }
 
+    if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
+        !detach->info.alias) {
+        if (qemuAssignDeviceNetAlias(vm->def, detach, -1) < 0)
+            goto cleanup;
+    }
+
     qemuDomainMarkDeviceForRemoval(vm, &detach->info);
 
     qemuDomainObjEnterMonitor(driver, vm);