From: Peter Krempa Date: Mon, 19 Oct 2015 12:01:22 +0000 (+0200) Subject: conf: Use local copy of maxvcpus in virDomainVcpuParse X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=310992c344a52b494a17a19540ecce4f4f375788;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git conf: Use local copy of maxvcpus in virDomainVcpuParse Use the local variable rather than getting it all the time from the struct. This will simplify further refactors. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 50ff301e7..91b045d04 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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; }