Qemu can also use the topology to calculate the total vcpu count. To
allow parsing this move the assignment earlier.
}
}
- if (maxcpus == 0)
- maxcpus = vcpus;
-
- if (maxcpus == 0)
- goto syntax;
-
- if (virDomainDefSetVcpusMax(dom, maxcpus, xmlopt) < 0)
- goto error;
-
- if (virDomainDefSetVcpus(dom, vcpus) < 0)
- goto error;
-
if (sockets && cores && threads) {
virCPUDefPtr cpu;
goto syntax;
}
+ if (maxcpus == 0)
+ maxcpus = vcpus;
+
+ if (maxcpus == 0)
+ goto syntax;
+
+ if (virDomainDefSetVcpusMax(dom, maxcpus, xmlopt) < 0)
+ goto error;
+
+ if (virDomainDefSetVcpus(dom, vcpus) < 0)
+ goto error;
+
ret = 0;
cleanup: