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