
On Fri, Sep 24, 2010 at 02:25:30PM -0600, Eric Blake wrote:
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
Yes I suggest to get 2 functions one for set and one for get allowing to do the full set of operations with the use of flags. Another question I had, is there a way in QEmu to specifiy a different cpu count from the -smp indicating the startup count ? Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/