Re: [PATCH 08/12] vcpu: support maxvcpu in domain_conf

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

 



[self-review]

On 09/29/2010 06:02 PM, Eric Blake wrote:

Two tightly-related changes.  One: virDomainGetInfo implicitly limits
vcpus to a 16-bit number; so there's no need to pretend otherwise
through the rest of the code.  Two: add a new maxvcpus member, but
for now, ensure that all domains treat vcpus == maxvcpus at all
times (domains that support hot-unplugging vcpus will be changed
in later patches).

@@ -4244,8 +4245,27 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
      if (node)
          def->hugepage_backed = 1;

-    if (virXPathULong("string(./vcpu[1])", ctxt,&def->vcpus)<  0)
-        def->vcpus = 1;
+    if (virXPathULong("string(./vcpu[1])", ctxt,&count)<  0)
+        def->maxvcpus = 1;
+    else {
+        def->maxvcpus = count;
+        if (def->maxvcpus != count || count == 0) {
+            virDomainReportError(VIR_ERR_INTERNAL_ERROR,
+                                 _("invalid maxvcpus %lu"), count);

Should this be VIR_ERR_XML_ERROR instead?

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[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]