Blame SOURCES/libvirt-test-replace-calls-to-individual-detach-functions-with-one-call-to-main-detach.patch

0a7476
From 621040f56e852c0b95be8aef20878b8a4012b9ee Mon Sep 17 00:00:00 2001
0a7476
Message-Id: <621040f56e852c0b95be8aef20878b8a4012b9ee@dist-git>
0a7476
From: Laine Stump <laine@laine.org>
0a7476
Date: Thu, 11 Apr 2019 15:14:43 -0400
0a7476
Subject: [PATCH] test: replace calls to individual detach functions with one
0a7476
 call to main detach
0a7476
0a7476
The individual qemuDomainDetach*Device() functions will soon be "less
0a7476
functional", since some of the code that is duplicated in 10 of the 12
0a7476
detach functions is going to be moved into the common
0a7476
qemuDomainDetachDeviceLive(), which calls them all.
0a7476
0a7476
qemuhotplugtest.c is the only place any of these individual functions
0a7476
is called other than qemuDomainDetachDeviceLive() itself. Fortunately,
0a7476
qemuDomainDetachDeviceLive() provides exactly the functionality needed
0a7476
by the test driver (except that it supports detach of more device
0a7476
types than the test driver has tests for).
0a7476
0a7476
This patch replaces the calls to
0a7476
qemuDomainDetach(Chr|Shmen|Watchdog|Disk)Device with a single call to
0a7476
the higher level function, allowing us to shift functionality between
0a7476
the lower level functions without breaking the tests.
0a7476
0a7476
Signed-off-by: Laine Stump <laine@laine.org>
0a7476
ACKed-by: Peter Krempa <pkrempa@redhat.com>
0a7476
(cherry picked from commit d3aab99096bb8f81600437682398235c17084d22)
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-32-laine@redhat.com>
0a7476
Acked-by: Michal Privoznik <mprivozn@redhat.com>
0a7476
---
0a7476
 tests/qemuhotplugtest.c | 8 +-------
0a7476
 1 file changed, 1 insertion(+), 7 deletions(-)
0a7476
0a7476
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
0a7476
index afaf706d27..f27fdbbb09 100644
0a7476
--- a/tests/qemuhotplugtest.c
0a7476
+++ b/tests/qemuhotplugtest.c
0a7476
@@ -149,16 +149,10 @@ testQemuHotplugDetach(virDomainObjPtr vm,
0a7476
 
0a7476
     switch (dev->type) {
0a7476
     case VIR_DOMAIN_DEVICE_DISK:
0a7476
-        ret = qemuDomainDetachDeviceDiskLive(&driver, vm, dev, async);
0a7476
-        break;
0a7476
     case VIR_DOMAIN_DEVICE_CHR:
0a7476
-        ret = qemuDomainDetachChrDevice(&driver, vm, dev->data.chr, async);
0a7476
-        break;
0a7476
     case VIR_DOMAIN_DEVICE_SHMEM:
0a7476
-        ret = qemuDomainDetachShmemDevice(&driver, vm, dev->data.shmem, async);
0a7476
-        break;
0a7476
     case VIR_DOMAIN_DEVICE_WATCHDOG:
0a7476
-        ret = qemuDomainDetachWatchdog(&driver, vm, dev->data.watchdog, async);
0a7476
+        ret = qemuDomainDetachDeviceLive(vm, dev, &driver, async);
0a7476
         break;
0a7476
     default:
0a7476
         VIR_TEST_VERBOSE("device type '%s' cannot be detached\n",
0a7476
-- 
0a7476
2.21.0
0a7476