1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

libxl: honor autoballoon setting in libxl.conf

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@suse.com>
This commit is contained in:
Jim Fehlig 2017-01-30 11:43:15 -07:00
parent 91ac80a986
commit ff225538d4

View File

@ -1355,8 +1355,11 @@ libxlGetAutoballoonConf(libxlDriverConfigPtr cfg,
regex_t regex; regex_t regex;
int res; int res;
if (virConfGetValueBool(conf, "autoballoon", &cfg->autoballoon) < 0) res = virConfGetValueBool(conf, "autoballoon", &cfg->autoballoon);
if (res < 0)
return -1; return -1;
else if (res == 1)
return 0;
if ((res = regcomp(&regex, if ((res = regcomp(&regex,
"(^| )dom0_mem=((|min:|max:)[0-9]+[bBkKmMgG]?,?)+($| )", "(^| )dom0_mem=((|min:|max:)[0-9]+[bBkKmMgG]?,?)+($| )",