[libvirt] RFC: add <currentVcpu> element
Eric Blake
eblake at redhat.com
Fri Sep 24 20:25:30 UTC 2010
On 09/23/2010 04:38 PM, Eric Blake wrote:
>
> At the library API layer, I plan on adding:
>
> virDomainSetMaxVcpus - alter the <vcpu> xml aspect of a domain for next
> boot; only affects persistent state
As I start to code this, it seems a bit redundant. I can avoid
virDomainSetMaxVcpus by
>
> virDomainSetVcpusFlags - alter the <currentVcpu> xml aspect of a domain,
> with a flag to state whether the change is persistent (inactive domains
> or affecting next boot of active domain) or live (active domains only).
using these flags:
VIR_SET_VCPU_MAXIMUM = 1
VIR_SET_VCPU_PERSISTENT = 2
such that
virDomainSetVcpusFlags(dom,1,0) - same as existing virDomainSetVcpus
virDomainSetVcpusFlags(dom,1,VIR_SET_VCPU_MAXIMUM) - error; can't change
max on active domain
virDomainSetVcpusFlags(dom,1,VIR_SET_VCPU_MAXIMUM|VIR_SET_VCPU_PERSISTENT)
- sets <vcpu> xml element for next boot
virDomainSetVcpusFlags(dom,1,VIR_SET_VCPU_PERSISTENT) - sets
<currentVcpu> xml element for next boot
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
More information about the libvir-list
mailing list