]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
hotplug: Check for alias in chrdev detach
authorJohn Ferlan <jferlan@redhat.com>
Wed, 8 Oct 2014 22:48:48 +0000 (18:48 -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 chr device alias has
been properly set before making the calls to detach the device

src/qemu/qemu_hotplug.c

index db39948a3cfcbbe6a154ce841c625c69d643a869..f79a37aeb75baeec9b5bae535dcf01fad4bd629d 100644 (file)
@@ -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;