From: John Ferlan Date: Wed, 8 Oct 2014 22:55:43 +0000 (-0400) Subject: hotplug: Check for alias in net detach X-Git-Tag: v1.2.10-rc1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96af61ddc1d1297200a497eb73628f0c3b0e3ad3;p=thirdparty%2Flibvirt.git hotplug: Check for alias in net detach 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 --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index f79a37aeb7..33241fb75c 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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);