[libvirt] [PATCH v2 08/12] qemu: Alter qemuDomainChgIOThread to take qemuMonitorIOThreadInfo

John Ferlan jferlan at redhat.com
Fri Oct 19 15:13:22 UTC 2018


Rather than passing an iothread_id, let's pass a qemuMonitorIOThreadInfo
structure so that a subsequent change to modify the iothread info can
just generate and pass one.

Signed-off-by: John Ferlan <jferlan at redhat.com>
ACKed-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/qemu/qemu_driver.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6835d3e875..4ddca2f765 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6026,7 +6026,7 @@ typedef enum {
 static int
 qemuDomainChgIOThread(virQEMUDriverPtr driver,
                       virDomainObjPtr vm,
-                      unsigned int iothread_id,
+                      qemuMonitorIOThreadInfo iothread,
                       virDomainIOThreadAction action,
                       unsigned int flags)
 {
@@ -6055,19 +6055,19 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
 
         switch (action) {
         case VIR_DOMAIN_IOTHREAD_ACTION_ADD:
-            if (qemuDomainAddIOThreadCheck(def, iothread_id) < 0)
+            if (qemuDomainAddIOThreadCheck(def, iothread.iothread_id) < 0)
                 goto endjob;
 
-            if (qemuDomainHotplugAddIOThread(driver, vm, iothread_id) < 0)
+            if (qemuDomainHotplugAddIOThread(driver, vm, iothread.iothread_id) < 0)
                 goto endjob;
 
             break;
 
         case VIR_DOMAIN_IOTHREAD_ACTION_DEL:
-            if (qemuDomainDelIOThreadCheck(def, iothread_id) < 0)
+            if (qemuDomainDelIOThreadCheck(def, iothread.iothread_id) < 0)
                 goto endjob;
 
-            if (qemuDomainHotplugDelIOThread(driver, vm, iothread_id) < 0)
+            if (qemuDomainHotplugDelIOThread(driver, vm, iothread.iothread_id) < 0)
                 goto endjob;
 
             break;
@@ -6080,19 +6080,19 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
     if (persistentDef) {
         switch (action) {
         case VIR_DOMAIN_IOTHREAD_ACTION_ADD:
-            if (qemuDomainAddIOThreadCheck(persistentDef, iothread_id) < 0)
+            if (qemuDomainAddIOThreadCheck(persistentDef, iothread.iothread_id) < 0)
                 goto endjob;
 
-            if (!virDomainIOThreadIDAdd(persistentDef, iothread_id))
+            if (!virDomainIOThreadIDAdd(persistentDef, iothread.iothread_id))
                 goto endjob;
 
             break;
 
         case VIR_DOMAIN_IOTHREAD_ACTION_DEL:
-            if (qemuDomainDelIOThreadCheck(persistentDef, iothread_id) < 0)
+            if (qemuDomainDelIOThreadCheck(persistentDef, iothread.iothread_id) < 0)
                 goto endjob;
 
-            virDomainIOThreadIDDel(persistentDef, iothread_id);
+            virDomainIOThreadIDDel(persistentDef, iothread.iothread_id);
 
             break;
         }
@@ -6119,6 +6119,7 @@ qemuDomainAddIOThread(virDomainPtr dom,
 {
     virQEMUDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm = NULL;
+    qemuMonitorIOThreadInfo iothread = {0};
     int ret = -1;
 
     virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
@@ -6136,7 +6137,8 @@ qemuDomainAddIOThread(virDomainPtr dom,
     if (virDomainAddIOThreadEnsureACL(dom->conn, vm->def, flags) < 0)
         goto cleanup;
 
-    ret = qemuDomainChgIOThread(driver, vm, iothread_id,
+    iothread.iothread_id = iothread_id;
+    ret = qemuDomainChgIOThread(driver, vm, iothread,
                                 VIR_DOMAIN_IOTHREAD_ACTION_ADD, flags);
 
  cleanup:
@@ -6152,6 +6154,7 @@ qemuDomainDelIOThread(virDomainPtr dom,
 {
     virQEMUDriverPtr driver = dom->conn->privateData;
     virDomainObjPtr vm = NULL;
+    qemuMonitorIOThreadInfo iothread = {0};
     int ret = -1;
 
     virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
@@ -6169,7 +6172,8 @@ qemuDomainDelIOThread(virDomainPtr dom,
     if (virDomainDelIOThreadEnsureACL(dom->conn, vm->def, flags) < 0)
            goto cleanup;
 
-    ret = qemuDomainChgIOThread(driver, vm, iothread_id,
+    iothread.iothread_id = iothread_id;
+    ret = qemuDomainChgIOThread(driver, vm, iothread,
                                 VIR_DOMAIN_IOTHREAD_ACTION_DEL, flags);
 
  cleanup:
-- 
2.17.2




More information about the libvir-list mailing list