render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
99cbc7
From c03d9e5f2d848a185ec262d0197d4d8dfb1f7f0e Mon Sep 17 00:00:00 2001
99cbc7
Message-Id: <c03d9e5f2d848a185ec262d0197d4d8dfb1f7f0e@dist-git>
99cbc7
From: Laine Stump <laine@laine.org>
99cbc7
Date: Thu, 11 Apr 2019 15:14:44 -0400
99cbc7
Subject: [PATCH] qemu_hotplug: make Detach functions called only from
99cbc7
 qemu_hotplug.c static
99cbc7
99cbc7
These are no longer called from qemu_driver.c, since the function that
99cbc7
called them (qemuDomainDetachDeviceLive()) has been moved to
99cbc7
qemu_hotplug.c, and they are no longer called from testqemuhotplug.c
99cbc7
because it now just called qemuDomainDetachDeviceLive() instead of all
99cbc7
the subordinate functions.
99cbc7
99cbc7
Signed-off-by: Laine Stump <laine@laine.org>
99cbc7
ACKed-by: Peter Krempa <pkrempa@redhat.com>
99cbc7
(cherry picked from commit 637d72f985e2700e88c3b3a4d4a83df9b8d6d35d)
99cbc7
99cbc7
Conflicts:
99cbc7
  src/qemu/qemu_hotplug.h - sentinel protecting from multiple inclusion
99cbc7
                            was renamed upstream, leading to difference
99cbc7
                            in context (but not in the lines that were
99cbc7
                            changed)
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-33-laine@redhat.com>
99cbc7
Acked-by: Michal Privoznik <mprivozn@redhat.com>
99cbc7
---
99cbc7
 src/qemu/qemu_hotplug.c | 47 +++++++++++++++++++------------------
99cbc7
 src/qemu/qemu_hotplug.h | 51 -----------------------------------------
99cbc7
 2 files changed, 25 insertions(+), 73 deletions(-)
99cbc7
99cbc7
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
99cbc7
index fd78f4ca01..b0f45708ae 100644
99cbc7
--- a/src/qemu/qemu_hotplug.c
99cbc7
+++ b/src/qemu/qemu_hotplug.c
99cbc7
@@ -4837,7 +4837,7 @@ qemuFindDisk(virDomainDefPtr def, const char *dst)
99cbc7
     return -1;
99cbc7
 }
99cbc7
 
99cbc7
-int
99cbc7
+static int
99cbc7
 qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
99cbc7
                                virDomainObjPtr vm,
99cbc7
                                virDomainDeviceDefPtr dev,
99cbc7
@@ -4988,10 +4988,11 @@ static bool qemuDomainControllerIsBusy(virDomainObjPtr vm,
99cbc7
     }
99cbc7
 }
99cbc7
 
99cbc7
-int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
99cbc7
-                                     virDomainObjPtr vm,
99cbc7
-                                     virDomainDeviceDefPtr dev,
99cbc7
-                                     bool async)
99cbc7
+static int
99cbc7
+qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
99cbc7
+                                 virDomainObjPtr vm,
99cbc7
+                                 virDomainDeviceDefPtr dev,
99cbc7
+                                 bool async)
99cbc7
 {
99cbc7
     int idx, ret = -1;
99cbc7
     virDomainControllerDefPtr detach = NULL;
99cbc7
@@ -5049,10 +5050,11 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
99cbc7
 
99cbc7
 
99cbc7
 /* search for a hostdev matching dev and detach it */
99cbc7
-int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
99cbc7
-                               virDomainObjPtr vm,
99cbc7
-                               virDomainDeviceDefPtr dev,
99cbc7
-                               bool async)
99cbc7
+static int
99cbc7
+qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
99cbc7
+                           virDomainObjPtr vm,
99cbc7
+                           virDomainDeviceDefPtr dev,
99cbc7
+                           bool async)
99cbc7
 {
99cbc7
     virDomainHostdevDefPtr hostdev = dev->data.hostdev;
99cbc7
     virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys;
99cbc7
@@ -5164,7 +5166,7 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
99cbc7
 }
99cbc7
 
99cbc7
 
99cbc7
-int
99cbc7
+static int
99cbc7
 qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
99cbc7
                             virDomainObjPtr vm,
99cbc7
                             virDomainShmemDefPtr dev,
99cbc7
@@ -5218,7 +5220,7 @@ qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
99cbc7
 }
99cbc7
 
99cbc7
 
99cbc7
-int
99cbc7
+static int
99cbc7
 qemuDomainDetachWatchdog(virQEMUDriverPtr driver,
99cbc7
                          virDomainObjPtr vm,
99cbc7
                          virDomainWatchdogDefPtr dev,
99cbc7
@@ -5273,7 +5275,7 @@ qemuDomainDetachWatchdog(virQEMUDriverPtr driver,
99cbc7
 }
99cbc7
 
99cbc7
 
99cbc7
-int
99cbc7
+static int
99cbc7
 qemuDomainDetachRedirdevDevice(virQEMUDriverPtr driver,
99cbc7
                                virDomainObjPtr vm,
99cbc7
                                virDomainRedirdevDefPtr dev,
99cbc7
@@ -5317,7 +5319,7 @@ qemuDomainDetachRedirdevDevice(virQEMUDriverPtr driver,
99cbc7
 }
99cbc7
 
99cbc7
 
99cbc7
-int
99cbc7
+static int
99cbc7
 qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
99cbc7
                           virDomainObjPtr vm,
99cbc7
                           virDomainDeviceDefPtr dev,
99cbc7
@@ -5383,10 +5385,11 @@ qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
99cbc7
 }
99cbc7
 
99cbc7
 
99cbc7
-int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
99cbc7
-                              virDomainObjPtr vm,
99cbc7
-                              virDomainChrDefPtr chr,
99cbc7
-                              bool async)
99cbc7
+static int
99cbc7
+qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
99cbc7
+                          virDomainObjPtr vm,
99cbc7
+                          virDomainChrDefPtr chr,
99cbc7
+                          bool async)
99cbc7
 {
99cbc7
     int ret = -1;
99cbc7
     qemuDomainObjPrivatePtr priv = vm->privateData;
99cbc7
@@ -5440,7 +5443,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
99cbc7
 }
99cbc7
 
99cbc7
 
99cbc7
-int
99cbc7
+static int
99cbc7
 qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
99cbc7
                           virDomainObjPtr vm,
99cbc7
                           virDomainRNGDefPtr rng,
99cbc7
@@ -5486,7 +5489,7 @@ qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
99cbc7
 }
99cbc7
 
99cbc7
 
99cbc7
-int
99cbc7
+static int
99cbc7
 qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
99cbc7
                              virDomainObjPtr vm,
99cbc7
                              virDomainMemoryDefPtr memdef,
99cbc7
@@ -5534,7 +5537,7 @@ qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
99cbc7
 }
99cbc7
 
99cbc7
 
99cbc7
-int
99cbc7
+static int
99cbc7
 qemuDomainDetachInputDevice(virDomainObjPtr vm,
99cbc7
                             virDomainInputDefPtr def,
99cbc7
                             bool async)
99cbc7
@@ -5585,7 +5588,7 @@ qemuDomainDetachInputDevice(virDomainObjPtr vm,
99cbc7
 }
99cbc7
 
99cbc7
 
99cbc7
-int
99cbc7
+static int
99cbc7
 qemuDomainDetachVsockDevice(virDomainObjPtr vm,
99cbc7
                             virDomainVsockDefPtr dev,
99cbc7
                             bool async)
99cbc7
@@ -5621,7 +5624,7 @@ qemuDomainDetachVsockDevice(virDomainObjPtr vm,
99cbc7
 }
99cbc7
 
99cbc7
 
99cbc7
-int
99cbc7
+static int
99cbc7
 qemuDomainDetachLease(virQEMUDriverPtr driver,
99cbc7
                       virDomainObjPtr vm,
99cbc7
                       virDomainLeaseDefPtr lease)
99cbc7
diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h
99cbc7
index 30b6fcc074..e8e4934db8 100644
99cbc7
--- a/src/qemu/qemu_hotplug.h
99cbc7
+++ b/src/qemu/qemu_hotplug.h
99cbc7
@@ -81,10 +81,6 @@ int qemuDomainFindGraphicsIndex(virDomainDefPtr def,
99cbc7
 int qemuDomainAttachMemory(virQEMUDriverPtr driver,
99cbc7
                            virDomainObjPtr vm,
99cbc7
                            virDomainMemoryDefPtr mem);
99cbc7
-int qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
99cbc7
-                                 virDomainObjPtr vm,
99cbc7
-                                 virDomainMemoryDefPtr memdef,
99cbc7
-                                 bool async);
99cbc7
 int qemuDomainChangeGraphics(virQEMUDriverPtr driver,
99cbc7
                              virDomainObjPtr vm,
99cbc7
                              virDomainGraphicsDefPtr dev);
99cbc7
@@ -101,35 +97,6 @@ int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
99cbc7
                                  virDomainObjPtr vm,
99cbc7
                                  virDomainNetDefPtr dev,
99cbc7
                                  int linkstate);
99cbc7
-int qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
99cbc7
-                                   virDomainObjPtr vm,
99cbc7
-                                   virDomainDeviceDefPtr dev,
99cbc7
-                                   bool async);
99cbc7
-int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
99cbc7
-                                     virDomainObjPtr vm,
99cbc7
-                                     virDomainDeviceDefPtr dev,
99cbc7
-                                     bool async);
99cbc7
-int qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
99cbc7
-                              virDomainObjPtr vm,
99cbc7
-                              virDomainDeviceDefPtr dev,
99cbc7
-                              bool async);
99cbc7
-int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
99cbc7
-                               virDomainObjPtr vm,
99cbc7
-                               virDomainDeviceDefPtr dev,
99cbc7
-                               bool async);
99cbc7
-int qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
99cbc7
-                                virDomainObjPtr vm,
99cbc7
-                                virDomainShmemDefPtr dev,
99cbc7
-                                bool async);
99cbc7
-int qemuDomainDetachWatchdog(virQEMUDriverPtr driver,
99cbc7
-                             virDomainObjPtr vm,
99cbc7
-                             virDomainWatchdogDefPtr watchdog,
99cbc7
-                             bool async);
99cbc7
-
99cbc7
-int qemuDomainDetachRedirdevDevice(virQEMUDriverPtr driver,
99cbc7
-                                   virDomainObjPtr vm,
99cbc7
-                                   virDomainRedirdevDefPtr dev,
99cbc7
-                                   bool async);
99cbc7
 
99cbc7
 int qemuDomainAttachInputDevice(virQEMUDriverPtr driver,
99cbc7
                                 virDomainObjPtr vm,
99cbc7
@@ -142,23 +109,12 @@ int qemuDomainAttachVsockDevice(virQEMUDriverPtr driver,
99cbc7
 int qemuDomainAttachLease(virQEMUDriverPtr driver,
99cbc7
                           virDomainObjPtr vm,
99cbc7
                           virDomainLeaseDefPtr lease);
99cbc7
-int qemuDomainDetachLease(virQEMUDriverPtr driver,
99cbc7
-                          virDomainObjPtr vm,
99cbc7
-                          virDomainLeaseDefPtr lease);
99cbc7
 int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
99cbc7
                               virDomainObjPtr vm,
99cbc7
                               virDomainChrDefPtr chr);
99cbc7
-int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
99cbc7
-                              virDomainObjPtr vm,
99cbc7
-                              virDomainChrDefPtr chr,
99cbc7
-                              bool async);
99cbc7
 int qemuDomainAttachRNGDevice(virQEMUDriverPtr driver,
99cbc7
                               virDomainObjPtr vm,
99cbc7
                               virDomainRNGDefPtr rng);
99cbc7
-int qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
99cbc7
-                              virDomainObjPtr vm,
99cbc7
-                              virDomainRNGDefPtr rng,
99cbc7
-                              bool async);
99cbc7
 
99cbc7
 int qemuDomainDetachDeviceLive(virDomainObjPtr vm,
99cbc7
                                virDomainDeviceDefPtr dev,
99cbc7
@@ -198,11 +154,4 @@ int qemuDomainSetVcpuInternal(virQEMUDriverPtr driver,
99cbc7
                               virBitmapPtr vcpus,
99cbc7
                               bool state);
99cbc7
 
99cbc7
-int qemuDomainDetachInputDevice(virDomainObjPtr vm,
99cbc7
-                                virDomainInputDefPtr def,
99cbc7
-                                bool async);
99cbc7
-
99cbc7
-int qemuDomainDetachVsockDevice(virDomainObjPtr vm,
99cbc7
-                                virDomainVsockDefPtr dev,
99cbc7
-                                bool async);
99cbc7
 #endif /* __QEMU_HOTPLUG_H__ */
99cbc7
-- 
99cbc7
2.21.0
99cbc7