render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Blob Blame History Raw
From b0664bfa45b1615cab1c66d502018e1c23d32529 Mon Sep 17 00:00:00 2001
Message-Id: <b0664bfa45b1615cab1c66d502018e1c23d32529@dist-git>
From: Laine Stump <laine@laine.org>
Date: Thu, 11 Apr 2019 15:14:45 -0400
Subject: [PATCH] qemu_hotplug: rename dev to match in
 qemuDomainDetachDeviceLive

I'm about to add a second virDomainDeviceDef to this function that
will point to the actual device in the domain object. while this is
just a partially filled-in example of what to look for. Naming it
match will make the code easier to follow.

Signed-off-by: Laine Stump <laine@laine.org>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit c4d6a121a8e903dc8d012d6737fd308b3ddec31a)

Partially-Resolves: https://bugzilla.redhat.com/1658198
Signed-off-by: Laine Stump <laine@redhat.com>
Signed-off-by: Laine Stump <laine@laine.org>
Message-Id: <20190411191453.24055-34-laine@redhat.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_hotplug.c | 32 ++++++++++++++++----------------
 src/qemu/qemu_hotplug.h |  2 +-
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index b0f45708ae..a655fc391f 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -5650,52 +5650,52 @@ qemuDomainDetachLease(virQEMUDriverPtr driver,
 
 int
 qemuDomainDetachDeviceLive(virDomainObjPtr vm,
-                           virDomainDeviceDefPtr dev,
+                           virDomainDeviceDefPtr match,
                            virQEMUDriverPtr driver,
                            bool async)
 {
     int ret = -1;
 
-    switch ((virDomainDeviceType)dev->type) {
+    switch ((virDomainDeviceType)match->type) {
     case VIR_DOMAIN_DEVICE_DISK:
-        ret = qemuDomainDetachDeviceDiskLive(driver, vm, dev, async);
+        ret = qemuDomainDetachDeviceDiskLive(driver, vm, match, async);
         break;
     case VIR_DOMAIN_DEVICE_CONTROLLER:
-        ret = qemuDomainDetachControllerDevice(driver, vm, dev, async);
+        ret = qemuDomainDetachControllerDevice(driver, vm, match, async);
         break;
     case VIR_DOMAIN_DEVICE_LEASE:
-        ret = qemuDomainDetachLease(driver, vm, dev->data.lease);
+        ret = qemuDomainDetachLease(driver, vm, match->data.lease);
         break;
     case VIR_DOMAIN_DEVICE_NET:
-        ret = qemuDomainDetachNetDevice(driver, vm, dev, async);
+        ret = qemuDomainDetachNetDevice(driver, vm, match, async);
         break;
     case VIR_DOMAIN_DEVICE_HOSTDEV:
-        ret = qemuDomainDetachHostDevice(driver, vm, dev, async);
+        ret = qemuDomainDetachHostDevice(driver, vm, match, async);
         break;
     case VIR_DOMAIN_DEVICE_CHR:
-        ret = qemuDomainDetachChrDevice(driver, vm, dev->data.chr, async);
+        ret = qemuDomainDetachChrDevice(driver, vm, match->data.chr, async);
         break;
     case VIR_DOMAIN_DEVICE_RNG:
-        ret = qemuDomainDetachRNGDevice(driver, vm, dev->data.rng, async);
+        ret = qemuDomainDetachRNGDevice(driver, vm, match->data.rng, async);
         break;
     case VIR_DOMAIN_DEVICE_MEMORY:
-        ret = qemuDomainDetachMemoryDevice(driver, vm, dev->data.memory, async);
+        ret = qemuDomainDetachMemoryDevice(driver, vm, match->data.memory, async);
         break;
     case VIR_DOMAIN_DEVICE_SHMEM:
-        ret = qemuDomainDetachShmemDevice(driver, vm, dev->data.shmem, async);
+        ret = qemuDomainDetachShmemDevice(driver, vm, match->data.shmem, async);
         break;
     case VIR_DOMAIN_DEVICE_WATCHDOG:
-        ret = qemuDomainDetachWatchdog(driver, vm, dev->data.watchdog, async);
+        ret = qemuDomainDetachWatchdog(driver, vm, match->data.watchdog, async);
         break;
     case VIR_DOMAIN_DEVICE_INPUT:
-        ret = qemuDomainDetachInputDevice(vm, dev->data.input, async);
+        ret = qemuDomainDetachInputDevice(vm, match->data.input, async);
         break;
     case VIR_DOMAIN_DEVICE_REDIRDEV:
-        ret = qemuDomainDetachRedirdevDevice(driver, vm, dev->data.redirdev, async);
+        ret = qemuDomainDetachRedirdevDevice(driver, vm, match->data.redirdev, async);
         break;
 
     case VIR_DOMAIN_DEVICE_VSOCK:
-        ret = qemuDomainDetachVsockDevice(vm, dev->data.vsock, async);
+        ret = qemuDomainDetachVsockDevice(vm, match->data.vsock, async);
         break;
 
     case VIR_DOMAIN_DEVICE_FS:
@@ -5713,7 +5713,7 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
     case VIR_DOMAIN_DEVICE_LAST:
         virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                        _("live detach of device '%s' is not supported"),
-                       virDomainDeviceTypeToString(dev->type));
+                       virDomainDeviceTypeToString(match->type));
         break;
     }
 
diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h
index e8e4934db8..699d61877f 100644
--- a/src/qemu/qemu_hotplug.h
+++ b/src/qemu/qemu_hotplug.h
@@ -117,7 +117,7 @@ int qemuDomainAttachRNGDevice(virQEMUDriverPtr driver,
                               virDomainRNGDefPtr rng);
 
 int qemuDomainDetachDeviceLive(virDomainObjPtr vm,
-                               virDomainDeviceDefPtr dev,
+                               virDomainDeviceDefPtr match,
                                virQEMUDriverPtr driver,
                                bool async);
 
-- 
2.21.0