Re: [PATCH 1/2] libxl: honor autoballoon setting in libxl.conf

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

 




On 02/02/2017 10:39 PM, Jim Fehlig wrote:
> libxlGetAutoballoonConf is supposed to honor user-specified
> autoballoon setting in libxl.conf. As written, the user-specified
> setting could be overwritten by the subsequent logic to check
> dom0_mem parameter. If user-specified setting is present and
> correct, accept it. Only fallback to checking Xen dom0_mem
> command line parameter if user-specfied setting is not present.
> 
> Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
Nice catch!

Reviewed-by: Joao Martins <joao.m.martins@xxxxxxxxxx>

> ---
>  src/libxl/libxl_conf.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> index b5186f2..ee1e639 100644
> --- a/src/libxl/libxl_conf.c
> +++ b/src/libxl/libxl_conf.c
> @@ -1355,8 +1355,11 @@ libxlGetAutoballoonConf(libxlDriverConfigPtr cfg,
>      regex_t regex;
>      int res;
>  
> -    if (virConfGetValueBool(conf, "autoballoon", &cfg->autoballoon) < 0)
> +    res = virConfGetValueBool(conf, "autoballoon", &cfg->autoballoon);
> +    if (res < 0)
>          return -1;
> +    else if (res == 1)
> +        return 0;
>  
>      if ((res = regcomp(&regex,
>                        "(^| )dom0_mem=((|min:|max:)[0-9]+[bBkKmMgG]?,?)+($| )",
> 

--
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]
  Powered by Linux