[libvirt] [PATCH 08/12] vcpu: support maxvcpu in domain_conf
Daniel Veillard
veillard at redhat.com
Fri Oct 1 15:02:00 UTC 2010
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 at veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
More information about the libvir-list
mailing list