SHA256
1
0
forked from pool/libvirt
libvirt/ff225538-libxl-autoballoon-setting.patch

33 lines
1.2 KiB
Diff
Raw Normal View History

commit ff225538d42f8e50bbc2c1c74d0a882ebaa73cd4
Author: Jim Fehlig <jfehlig@suse.com>
Date: Mon Jan 30 11:43:15 2017 -0700
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>
Index: libvirt-3.0.0/src/libxl/libxl_conf.c
===================================================================
--- libvirt-3.0.0.orig/src/libxl/libxl_conf.c
+++ libvirt-3.0.0/src/libxl/libxl_conf.c
@@ -1381,8 +1381,11 @@ libxlGetAutoballoonConf(libxlDriverConfi
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]?,?)+($| )",