[PATCH 3/5] qemuBuildNumaCommandLine: Move vars into loops

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

 



There are two variables that are used only in a single
loop. Move their definitions into their respective blocks.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 3de37aa5c5..020cbfa214 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7416,11 +7416,9 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg,
     size_t i, j;
     virQEMUCaps *qemuCaps = priv->qemuCaps;
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
-    char *next = NULL;
     virBuffer *nodeBackends = NULL;
     bool needBackend = false;
     bool hmat = false;
-    int rc;
     int ret = -1;
     size_t ncells = virDomainNumaGetNodeCount(def->numa);
     ssize_t masterInitiator = -1;
@@ -7445,6 +7443,7 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg,
     if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM) ||
         virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE) ||
         virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_MEMFD)) {
+        int rc;
 
         for (i = 0; i < ncells; i++) {
             if ((rc = qemuBuildMemoryCellBackendStr(def, cfg, i, priv,
@@ -7487,6 +7486,7 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg,
 
         if (cpumask) {
             g_autofree char *cpumaskStr = NULL;
+            char *next = NULL;
             char *tmpmask;
 
             if (!(cpumaskStr = virBitmapFormat(cpumask)))
-- 
2.32.0




[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