[PATCH 09/14] qemu: pass priv data instead of qemuCaps and autoNodeset

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

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 33 ++++++++++++++-------------------
 1 file changed, 14 insertions(+), 19 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 5441f5e37f..db6cc55495 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3543,10 +3543,9 @@ qemuBuildMemoryBackendStr(virJSONValuePtr *backendProps,
 
 static int
 qemuBuildMemoryCellBackendStr(virDomainDefPtr def,
-                              virQEMUCapsPtr qemuCaps,
                               virQEMUDriverConfigPtr cfg,
                               size_t cell,
-                              virBitmapPtr auto_nodeset,
+                              qemuDomainObjPrivatePtr priv,
                               char **backendStr)
 {
     virJSONValuePtr props = NULL;
@@ -3565,8 +3564,8 @@ qemuBuildMemoryCellBackendStr(virDomainDefPtr def,
     if (virAsprintf(&alias, "ram-node%zu", cell) < 0)
         goto cleanup;
 
-    if ((rc = qemuBuildMemoryBackendStr(&props, &backendType, cfg, qemuCaps,
-                                        def, &mem, auto_nodeset, false)) < 0)
+    if ((rc = qemuBuildMemoryBackendStr(&props, &backendType, cfg, priv->qemuCaps,
+                                        def, &mem, priv->autoNodeset, false)) < 0)
         goto cleanup;
 
     if (!(*backendStr = virQEMUBuildObjectCommandlineFromJSON(backendType,
@@ -3587,9 +3586,8 @@ qemuBuildMemoryCellBackendStr(virDomainDefPtr def,
 static char *
 qemuBuildMemoryDimmBackendStr(virDomainMemoryDefPtr mem,
                               virDomainDefPtr def,
-                              virQEMUCapsPtr qemuCaps,
                               virQEMUDriverConfigPtr cfg,
-                              virBitmapPtr auto_nodeset)
+                              qemuDomainObjPrivatePtr priv)
 {
     virJSONValuePtr props = NULL;
     char *alias = NULL;
@@ -3605,8 +3603,8 @@ qemuBuildMemoryDimmBackendStr(virDomainMemoryDefPtr mem,
     if (virAsprintf(&alias, "mem%s", mem->info.alias) < 0)
         goto cleanup;
 
-    if (qemuBuildMemoryBackendStr(&props, &backendType, cfg, qemuCaps,
-                                  def, mem, auto_nodeset, true) < 0)
+    if (qemuBuildMemoryBackendStr(&props, &backendType, cfg, priv->qemuCaps,
+                                  def, mem, priv->autoNodeset, true) < 0)
         goto cleanup;
 
     ret = virQEMUBuildObjectCommandlineFromJSON(backendType, alias, props);
@@ -7717,10 +7715,10 @@ static int
 qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
                     virDomainDefPtr def,
                     virCommandPtr cmd,
-                    virQEMUCapsPtr qemuCaps,
-                    virBitmapPtr auto_nodeset)
+                    qemuDomainObjPrivatePtr priv)
 {
     size_t i;
+    virQEMUCapsPtr qemuCaps = priv->qemuCaps;
     virBuffer buf = VIR_BUFFER_INITIALIZER;
     char *cpumask = NULL, *tmpmask = NULL, *next = NULL;
     char **nodeBackends = NULL;
@@ -7748,7 +7746,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
         goto cleanup;
     }
 
-    if (!virDomainNumatuneNodesetIsAvailable(def->numa, auto_nodeset))
+    if (!virDomainNumatuneNodesetIsAvailable(def->numa, priv->autoNodeset))
         goto cleanup;
 
     for (i = 0; i < def->mem.nhugepages; i++) {
@@ -7783,8 +7781,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
     for (i = 0; i < ncells; i++) {
         if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM) ||
             virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE)) {
-            if ((rc = qemuBuildMemoryCellBackendStr(def, qemuCaps, cfg, i,
-                                                    auto_nodeset,
+            if ((rc = qemuBuildMemoryCellBackendStr(def, cfg, i, priv,
                                                     &nodeBackends[i])) < 0)
                 goto cleanup;
 
@@ -7859,8 +7856,7 @@ static int
 qemuBuildMemoryDeviceCommandLine(virCommandPtr cmd,
                                  virQEMUDriverConfigPtr cfg,
                                  virDomainDefPtr def,
-                                 virQEMUCapsPtr qemuCaps,
-                                 virBitmapPtr nodeset)
+                                 qemuDomainObjPrivatePtr priv)
 {
     size_t i;
 
@@ -7871,7 +7867,7 @@ qemuBuildMemoryDeviceCommandLine(virCommandPtr cmd,
         char *dimmStr;
 
         if (!(backStr = qemuBuildMemoryDimmBackendStr(def->mems[i], def,
-                                                      qemuCaps, cfg, nodeset)))
+                                                      cfg, priv)))
             return -1;
 
         if (!(dimmStr = qemuBuildMemoryDeviceStr(def->mems[i]))) {
@@ -9960,7 +9956,6 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
     qemuDomainObjPrivatePtr priv = vm->privateData;
     virDomainDefPtr def = vm->def;
     virQEMUCapsPtr qemuCaps = priv->qemuCaps;
-    virBitmapPtr nodeset = priv->autoNodeset;
     bool chardevStdioLogd = priv->chardevStdioLogd;
 
     VIR_DEBUG("driver=%p def=%p mon=%p json=%d "
@@ -10016,10 +10011,10 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
         goto error;
 
     if (virDomainNumaGetNodeCount(def->numa) &&
-        qemuBuildNumaArgStr(cfg, def, cmd, qemuCaps, nodeset) < 0)
+        qemuBuildNumaArgStr(cfg, def, cmd, priv) < 0)
         goto error;
 
-    if (qemuBuildMemoryDeviceCommandLine(cmd, cfg, def, qemuCaps, nodeset) < 0)
+    if (qemuBuildMemoryDeviceCommandLine(cmd, cfg, def, priv) < 0)
         goto error;
 
     virUUIDFormat(def->uuid, uuid);
-- 
2.13.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux