Blame SOURCES/libvirt-qemu_hotplug-Don-t-build-device-string-in-qemuDomainDetachChrDevice.patch

0a7476
From 9ab3c57972a8a9f762a3905216478e576f0966cf Mon Sep 17 00:00:00 2001
0a7476
Message-Id: <9ab3c57972a8a9f762a3905216478e576f0966cf@dist-git>
0a7476
From: Michal Privoznik <mprivozn@redhat.com>
0a7476
Date: Thu, 11 Apr 2019 15:14:21 -0400
0a7476
Subject: [PATCH] qemu_hotplug: Don't build device string in
0a7476
 qemuDomainDetachChrDevice
0a7476
0a7476
This is basically an old artefact from 24b0821926e when the idea
0a7476
was:
0a7476
0a7476
1) Build device string only to see if chardev has any -device
0a7476
associated with it and thus if device_del is needed
0a7476
2) Detach chardev using chardev_del
0a7476
0a7476
Now, that DEVICE and DEVICE_DELETED capabilities are assumed for
0a7476
every domain 1) does not make sense anymore.
0a7476
0a7476
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
0a7476
Reviewed-by: John Ferlan <jferlan@redhat.com>
0a7476
(cherry picked from commit 0c17685760a3ec8bf06c793d47d82dd51428451a)
0a7476
0a7476
Partially-Resolves: https://bugzilla.redhat.com/1658198
0a7476
Signed-off-by: Laine Stump <laine@redhat.com>
0a7476
Signed-off-by: Laine Stump <laine@laine.org>
0a7476
Message-Id: <20190411191453.24055-10-laine@redhat.com>
0a7476
Acked-by: Michal Privoznik <mprivozn@redhat.com>
0a7476
---
0a7476
 src/qemu/qemu_hotplug.c | 7 +------
0a7476
 1 file changed, 1 insertion(+), 6 deletions(-)
0a7476
0a7476
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
0a7476
index 43dec329b6..d4444bbb5d 100644
0a7476
--- a/src/qemu/qemu_hotplug.c
0a7476
+++ b/src/qemu/qemu_hotplug.c
0a7476
@@ -5592,7 +5592,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
0a7476
     qemuDomainObjPrivatePtr priv = vm->privateData;
0a7476
     virDomainDefPtr vmdef = vm->def;
0a7476
     virDomainChrDefPtr tmpChr;
0a7476
-    char *devstr = NULL;
0a7476
     bool guestfwd = false;
0a7476
 
0a7476
     if (!(tmpChr = virDomainChrFind(vmdef, chr))) {
0a7476
@@ -5613,9 +5612,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
0a7476
 
0a7476
     sa_assert(tmpChr->info.alias);
0a7476
 
0a7476
-    if (qemuBuildChrDeviceStr(&devstr, vmdef, tmpChr, priv->qemuCaps) < 0)
0a7476
-        goto cleanup;
0a7476
-
0a7476
     if (!async && !guestfwd)
0a7476
         qemuDomainMarkDeviceForRemoval(vm, &tmpChr->info);
0a7476
 
0a7476
@@ -5626,7 +5622,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
0a7476
             goto cleanup;
0a7476
         }
0a7476
     } else {
0a7476
-        if (devstr && qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {
0a7476
+        if (qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {
0a7476
             ignore_value(qemuDomainObjExitMonitor(driver, vm));
0a7476
             goto cleanup;
0a7476
         }
0a7476
@@ -5646,7 +5642,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
0a7476
  cleanup:
0a7476
     if (!async)
0a7476
         qemuDomainResetDeviceRemoval(vm);
0a7476
-    VIR_FREE(devstr);
0a7476
     return ret;
0a7476
 }
0a7476
 
0a7476
-- 
0a7476
2.21.0
0a7476