]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Move memory size detection to the top of the function
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 1 Oct 2015 05:30:39 +0000 (07:30 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 2 Oct 2015 14:14:26 +0000 (16:14 +0200)
To get rid of very long line and make it more readable.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_command.c

index c8d320e98f23af89aabbb5ac319d68a90b396c3f..6168745ac1bc3ac540947f3bc017a6ead640d850 100644 (file)
@@ -5249,17 +5249,17 @@ qemuBuildMemoryCellBackendStr(virDomainDefPtr def,
     const char *backendType;
     int ret = -1;
     int rc;
+    unsigned long long memsize = virDomainNumaGetNodeMemorySize(def->numa,
+                                                                cell);
 
     *backendStr = NULL;
 
     if (virAsprintf(&alias, "ram-node%zu", cell) < 0)
         goto cleanup;
 
-    if ((rc = qemuBuildMemoryBackendStr(virDomainNumaGetNodeMemorySize(def->numa, cell),
-                                        0, cell,
-                                        NULL, auto_nodeset,
-                                        def, qemuCaps, cfg,
-                                        &backendType, &props, false)) < 0)
+    if ((rc = qemuBuildMemoryBackendStr(memsize, 0, cell, NULL, auto_nodeset,
+                                        def, qemuCaps, cfg, &backendType,
+                                        &props, false)) < 0)
         goto cleanup;
 
     if (!(*backendStr = qemuBuildObjectCommandlineFromJSON(backendType,