Re: [PATCH] Don't call virCgroupSetCpuShares with a zero value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/13/2013 09:18 AM, Ján Tomko wrote:
> In the XML parser, a zero in the <shares> element is treated
> as if it was omitted completely. No value is written to
> the cgroups fs when the domain is started and the OS default
> is used.
> 
> virDomainSetSchedulerParameters treated 0 as a valid value,
> which got changed to '2' by kernel. Treat 0 as 'not specified'
> instead, to be consistent with the XML and how other scheduler
> parameters deal with a 0 value, making it a no-op on live domains.
> 
> Also clarify the documentation.
> ---

> +++ b/src/lxc/lxc_driver.c
> @@ -1732,7 +1732,7 @@ lxcDomainSetSchedulerParametersFlags(virDomainPtr dom,
>          virTypedParameterPtr param = &params[i];
>  
>          if (STREQ(param->field, VIR_DOMAIN_SCHEDULER_CPU_SHARES)) {
> -            if (flags & VIR_DOMAIN_AFFECT_LIVE) {
> +            if (flags & VIR_DOMAIN_AFFECT_LIVE && params[i].value.ul) {
>                  if (virCgroupSetCpuShares(priv->cgroup, params[i].value.ul) < 0)

If the value was previously set to non-zero, don't you need to do
something to explicitly unset that old value, rather than just ignoring
the option altogether?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]