]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
conf: Use local copy of maxvcpus in virDomainVcpuParse
authorPeter Krempa <pkrempa@redhat.com>
Mon, 19 Oct 2015 12:01:22 +0000 (14:01 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 9 Dec 2015 13:57:12 +0000 (14:57 +0100)
Use the local variable rather than getting it all the time from the
struct. This will simplify further refactors.

src/conf/domain_conf.c

index 50ff301e79c4bd174bb92118863027e1a483b17e..91b045d04a1e8aae4bec303158c6f258306945f0 100644 (file)
@@ -14407,13 +14407,13 @@ virDomainVcpuParse(virDomainDefPtr def,
             goto cleanup;
         }
 
-        def->vcpus = def->maxvcpus;
+        def->vcpus = maxvcpus;
     }
 
-    if (def->maxvcpus < def->vcpus) {
+    if (maxvcpus < def->vcpus) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("maxvcpus must not be less than current vcpus "
-                         "(%u < %u)"), def->maxvcpus, def->vcpus);
+                         "(%u < %u)"), maxvcpus, def->vcpus);
         goto cleanup;
     }