[libvirt] [PATCH] manage number of virtual CPUs

Evgeniy Sokolov evg at openvz.org
Thu Aug 14 14:31:31 UTC 2008


> On Wed, Aug 13, 2008 at 05:04:45PM +0400, Evgeniy Sokolov wrote:
>> +static int openvzGetMaxVCPUs(virConnectPtr conn, const char *type) {
>> +    if (STRCASEEQ(type, "openvz"))
>> +        return 4096; //OpenVZ has no limitation
> 
> This should be 1024 since that's the max CPUs exposed by the kernel
> to userspace for  sched params.
> 
>> +    if (virRun(conn, (char **)prog, NULL) < 0) {
>> +        openvzError(conn, VIR_ERR_INTERNAL_ERROR,
>> +                             _("Could not exec %s"), VZCTL);
>> +        return -1;
>> +    }
> 
> There's no need to cast to '(char **)' anymore - virRun has
> the correct constness defined.
> 
> With those two things changed this looks fine to commit
Thanks for review!

fixed patch is attached.

> 
> Regards,
> Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-openvz-manage_nvcpus.diff
Type: text/x-patch
Size: 5542 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080814/8271dbb8/attachment-0001.bin>


More information about the libvir-list mailing list