]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Use @tmpChr in qemuDomainDetachChrDevice to build device string
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 11 Feb 2019 13:13:39 +0000 (14:13 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 14 Feb 2019 08:15:02 +0000 (09:15 +0100)
So far we are passing @chr to qemuBuildChrDeviceStr. This is
suboptimal (in fact wrong) because @chr is just parsed XML
definition provided by user which by definition may lack some
information. On the other hand, @tmpChr is the one that was found
using @chr in domain definition so it contains the same amount of
information or more.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_hotplug.c

index 38600b33f803ff887b608e4b5d0c117d5bda928c..01920a78f572589a05737d9c22d232783c18185a 100644 (file)
@@ -6131,7 +6131,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
 
     sa_assert(tmpChr->info.alias);
 
-    if (qemuBuildChrDeviceStr(&devstr, vmdef, chr, priv->qemuCaps) < 0)
+    if (qemuBuildChrDeviceStr(&devstr, vmdef, tmpChr, priv->qemuCaps) < 0)
         goto cleanup;
 
     if (!async)