From: John Ferlan Date: Wed, 8 Oct 2014 22:45:39 +0000 (-0400) Subject: hotplug: Check for alias in hostdev detach X-Git-Tag: v1.2.10-rc1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9de26f27cfa6a32ce9a23e30a58991432bdcbee5;p=thirdparty%2Flibvirt.git hotplug: Check for alias in hostdev detach 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 3e8cdbfc62..db39948a3c 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3371,8 +3371,15 @@ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver, virDomainObjPtr vm, virDomainHostdevDefPtr detach) { + qemuDomainObjPrivatePtr priv = vm->privateData; int ret = -1; + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) && + !detach->info->alias) { + if (qemuAssignDeviceHostdevAlias(vm->def, detach, -1) < 0) + return -1; + } + switch (detach->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: ret = qemuDomainDetachHostPCIDevice(driver, vm, detach);