[libvirt] PATCH: allow to set nvcpus = 0

Evgeniy Sokolov evg at openvz.org
Wed Nov 19 16:59:27 UTC 2008

> On Mon, Nov 17, 2008 at 06:44:07PM +0300, Evgeniy Sokolov wrote:
>> OpenVZ uses all CPUs available in system
>> - by default (number of CPUs did not set)
>> - number of CPUs = 0
>> Currenty, libvirt don't allow to set nvcpus = 0
>> Attached patch removes limitation in libvirt set nvcpu = 0, but add it 
>> to each driver which allow to set number of virtual CPU. For OpenVZ set 
>> default number of CPUs = 0.
> This is the wrong way to handle this. If OpenVZ allows the container
> to use all the host CPUs, then the vCPUs number should reflect the
> number of pCPUs, not 0. So when loading the openvz config, if there
> is no CPUS=  setting in the config file, the driver should fill in
> the number of host pCPUs. Likewise, when setting the openvz config,
> if the vCPUs in the XML is >=  pCPUs, then it should just leave
> out the CPUS= setting, so OpenVZ uses all CPUs.
It is not like in OpenVZ, but good way. Attached patch implement it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-openvz-read-pcpus.diff
Type: text/x-patch
Size: 2617 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20081119/ac372f8a/attachment-0001.bin>

More information about the libvir-list mailing list