From: John Ferlan Date: Wed, 8 Oct 2014 22:48:48 +0000 (-0400) Subject: hotplug: Check for alias in chrdev detach X-Git-Tag: v1.2.10-rc1~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4d8a4165a797a3c8a3dc46ceba28796f24e8ea78;p=thirdparty%2Flibvirt.git hotplug: Check for alias in chrdev detach If the QEMU_CAPS_DEVICE is set, then ensure the chr 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 db39948a3c..f79a37aeb7 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3696,6 +3696,12 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver, return ret; } + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) && + !tmpChr->info.alias) { + if (qemuAssignDeviceChrAlias(vmdef, tmpChr, -1) < 0) + return ret; + } + if (qemuBuildChrDeviceStr(&devstr, vm->def, chr, priv->qemuCaps) < 0) return ret;