|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] Question about vcpu_avail
On 11/23/2009 04:28 PM, Keir Fraser wrote: On 23/11/2009 15:02, "Michal Novotny"<minovotn@xxxxxxxxxx> wrote:I would like to ask about vcpu_avail variable in XendDomainInfo.py. Is that variable working and what is it used for ? I think it's a bitmask showing what VCPUs are used and what are not, am I correct? Well, I don't know Keir since the main use scenario for maxvcpus is to set number of vcpus for the guest so a new definition in Xend should be required. Then you just issue `xm vcpu-set {domainName} {numberOfVcpus}` command to change number of VCPUs used by the guest, method `setVCpuCount(self, vcpus)` from XendDomainInfo.py is called to set number of VCpus so check should be implemented here as:
def setVCpuCount(self, vcpus):
if vcpus > self.info['maxvcpus']:
log.debug("Cannot set %d vcpu(s) for domain %s (domid %d)."
"Maximum number of vcpu(s) is set to %d" %
(vcpus, self.info['name'], self.domid,
self.info['maxvcpus']))
raise VmError("Cannot set %d vcpu(s). Maximum number of
vcpus for "
"this domain is %d" % (vcpus,
self.info['maxvcpus']) )
self.info['vcpu_avail'] = (1 << vcpus) - 1
self.storeVm('vcpu_avail', self.info['vcpu_avail'])
And domain_max_vcpus() call should be changed from
`xc.domain_max_vcpus(self.domid, int(self.info['vcpus']))` to
`xc.domain_max_vcpus(self.domid, int(self.info['maxvcpus']))`.
The only change that should be done to xm/create.py is to add `maxvcpus` to add_conf mapping to allow it to be read/parsed out from the config file. Well, I've been looking to the code and there is self.info['VCPUs_max'] in XendDomainInfo.py. What is it used for? Could it be used for the same purpose like `maxvcpus` from example above? Michal
_______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |