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.