99cbc7
From 9a0d6a2eac4a69d548620f80ed0c71fc0cb6d415 Mon Sep 17 00:00:00 2001
99cbc7
Message-Id: <9a0d6a2eac4a69d548620f80ed0c71fc0cb6d415@dist-git>
99cbc7
From: Michal Privoznik <mprivozn@redhat.com>
99cbc7
Date: Thu, 11 Apr 2019 15:14:16 -0400
99cbc7
Subject: [PATCH] qemu: Use @tmpChr in qemuDomainDetachChrDevice to build
99cbc7
 device string
99cbc7
99cbc7
So far we are passing @chr to qemuBuildChrDeviceStr. This is
99cbc7
suboptimal (in fact wrong) because @chr is just parsed XML
99cbc7
definition provided by user which by definition may lack some
99cbc7
information. On the other hand, @tmpChr is the one that was found
99cbc7
using @chr in domain definition so it contains the same amount of
99cbc7
information or more.
99cbc7
99cbc7
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
99cbc7
Reviewed-by: John Ferlan <jferlan@redhat.com>
99cbc7
(cherry picked from commit f538f5ed3a876c3cb67ae5b7a01f133f192aca13)
99cbc7
99cbc7
Partially-Resolves: https://bugzilla.redhat.com/1658198
99cbc7
Signed-off-by: Laine Stump <laine@redhat.com>
99cbc7
Signed-off-by: Laine Stump <laine@laine.org>
99cbc7
Message-Id: <20190411191453.24055-5-laine@redhat.com>
99cbc7
Acked-by: Michal Privoznik <mprivozn@redhat.com>
99cbc7
---
99cbc7
 src/qemu/qemu_hotplug.c | 2 +-
99cbc7
 1 file changed, 1 insertion(+), 1 deletion(-)
99cbc7
99cbc7
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
99cbc7
index 5e11e1997a..46cafef4c2 100644
99cbc7
--- a/src/qemu/qemu_hotplug.c
99cbc7
+++ b/src/qemu/qemu_hotplug.c
99cbc7
@@ -5594,7 +5594,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
99cbc7
 
99cbc7
     sa_assert(tmpChr->info.alias);
99cbc7
 
99cbc7
-    if (qemuBuildChrDeviceStr(&devstr, vmdef, chr, priv->qemuCaps) < 0)
99cbc7
+    if (qemuBuildChrDeviceStr(&devstr, vmdef, tmpChr, priv->qemuCaps) < 0)
99cbc7
         goto cleanup;
99cbc7
 
99cbc7
     if (!async)
99cbc7
-- 
99cbc7
2.21.0
99cbc7