[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH v3 08/13] Introduce qemuDomain*DeviceLiveInternal



This helps moving some checks into the top function
before actually going ahead with the operation.

Signed-off-by: Shivaprasad G Bhat <sbhat linux vnet ibm com>
---
 src/qemu/qemu_hotplug.c |   47 +++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 39 insertions(+), 8 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index c191919..96caef3 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -4256,8 +4256,9 @@ qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
     return ret;
 }
 
-int
-qemuDomainAttachDeviceLive(virDomainObjPtr vm,
+
+static int
+qemuDomainAttachDeviceLiveInternal(virDomainObjPtr vm,
                            virDomainDeviceDefPtr dev,
                            virDomainPtr dom)
 {
@@ -4380,6 +4381,14 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
     return ret;
 }
 
+int
+qemuDomainAttachDeviceLive(virDomainObjPtr vm,
+                           virDomainDeviceDefPtr dev,
+                           virDomainPtr dom)
+{
+    return qemuDomainAttachDeviceLiveInternal(vm, dev, dom);
+}
+
 static int
 qemuDomainDetachDeviceControllerLive(virQEMUDriverPtr driver,
                                      virDomainObjPtr vm,
@@ -4400,10 +4409,10 @@ qemuDomainDetachDeviceControllerLive(virQEMUDriverPtr driver,
     return ret;
 }
 
-int
-qemuDomainDetachDeviceLive(virDomainObjPtr vm,
-                           virDomainDeviceDefPtr dev,
-                           virDomainPtr dom)
+static int
+qemuDomainDetachDeviceLiveInternal(virDomainObjPtr vm,
+                                   virDomainDeviceDefPtr dev,
+                                   virDomainPtr dom)
 {
     virQEMUDriverPtr driver = dom->conn->privateData;
     int ret = -1;
@@ -4462,6 +4471,16 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
     return ret;
 }
 
+
+int
+qemuDomainDetachDeviceLive(virDomainObjPtr vm,
+                           virDomainDeviceDefPtr dev,
+                           virDomainPtr dom)
+{
+    return qemuDomainDetachDeviceLiveInternal(vm, dev, dom);
+}
+
+
 static int
 qemuDomainChangeDiskLive(virConnectPtr conn,
                          virDomainObjPtr vm,
@@ -4542,8 +4561,9 @@ qemuDomainChangeDiskLive(virConnectPtr conn,
     goto cleanup;
 }
 
-int
-qemuDomainUpdateDeviceLive(virConnectPtr conn,
+
+static int
+qemuDomainUpdateDeviceLiveInternal(virConnectPtr conn,
                            virDomainObjPtr vm,
                            virDomainDeviceDefPtr dev,
                            virDomainPtr dom,
@@ -4592,3 +4612,14 @@ qemuDomainUpdateDeviceLive(virConnectPtr conn,
 
     return ret;
 }
+
+int
+qemuDomainUpdateDeviceLive(virConnectPtr conn,
+                           virDomainObjPtr vm,
+                           virDomainDeviceDefPtr dev,
+                           virDomainPtr dom,
+                           bool force)
+{
+    return qemuDomainUpdateDeviceLiveInternal(conn, vm, dev,
+                                              dom, force);
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]