[Libvir] [PATCH] Implement SetVcpus and DomainGetMaxVcpus for qemu

Chris Lalancette clalance at redhat.com
Mon Apr 28 18:38:52 UTC 2008

Cole Robinson wrote:
> The attached patch fills in two of the vcpu functions for the qemu driver:
> virDomainSetVcpus : set the number of vcpus the domain can use
> virDomainGetMaxVcpus : max number of vcpus that can be assigned to the domain.
> Code change is only in qemu_driver, as the backend stuff was already in place.
> I also edited qemudGetMaxVcpus to ignore case when checking the passed OS
> type, since it wasn't matching the returned results of qemudDomainGetOSType.

OK, but...

> +    if (qemudIsActiveVM(vm)) {
> +        qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
> +                         _("cannot change vcpu count of an active domain"));
> +        return -1;
> +    }

I'm fairly certain KVM is going to support this in the near future (if not now,
I can't remember).  I'm not sure what libvirt's policy is about things that
don't work now, but will potentially work in the future, is, but it seems wrong
to disable this feature for KVM.

Chris Lalancette

More information about the libvir-list mailing list