On Thu, Sep 30, 2010 at 01:27:27PM -0600, Eric Blake wrote: > [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? Ah, yes :-) Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@xxxxxxxxxxxx | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list