SHA256
1
0
forked from pool/libvirt
libvirt/suse-libxl-disable-autoballoon.patch
James Fehlig 06eb24a4dd Accepting request 796123 from home:jfehlig:branches:Virtualization
- libxl: Add support for 'passthrough' and 'e820_host' settings
  b7d6648d-conf-add-e820-host.patch,
  5749395b-libxl-e820-host.patch,
  f3ef7daf-xenconfig-e820-host.patch,
  34077c1b-tests-check-e820-host.patch,
  fadbaa23-conf-add-passthrough.patch,
  9529e007-libxl-passthrough.patch,
  9cb8bc6f-xenconfig-refactor-features.patch,
  b523e225-xenconfig-passthrough.patch,
  bed32525-tests-check-passthrough.patch
  bsc#1167217

OBS-URL: https://build.opensuse.org/request/show/796123
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=823
2020-04-21 20:56:47 +00:00

69 lines
2.4 KiB
Diff

libxl: disable autoballooning
Xen 4.12 introduced a CONFIG_DOM0_MEM option, which our xen package uses
to configure dom0 with a sensible initial memory value and disables
autoballooning. This patch changes libvirt to also disable autoballooning
by default. It can only be enabled with the 'autoballoon' setting in
libxl.conf. See jsc#SLE-3059 for more details.
Index: libvirt-6.2.0/src/libxl/libxl.conf
===================================================================
--- libvirt-6.2.0.orig/src/libxl/libxl.conf
+++ libvirt-6.2.0/src/libxl/libxl.conf
@@ -4,12 +4,11 @@
# Enable autoballooning of domain0
#
-# By default, autoballooning of domain0 is enabled unless its memory
-# is already limited with Xen's "dom0_mem=" parameter, in which case
-# autoballooning is disabled. Override the default behavior with the
-# autoballoon setting.
+# By default, autoballooning of domain0 is disabled. Traditionally it
+# could also be disabled by using Xen's "dom0_mem=" parameter. Set to
+# 1 to enable autoballooning.
#
-#autoballoon = 1
+#autoballoon = 0
# In order to prevent accidentally starting two domains that
Index: libvirt-6.2.0/src/libxl/libxl_conf.c
===================================================================
--- libvirt-6.2.0.orig/src/libxl/libxl_conf.c
+++ libvirt-6.2.0/src/libxl/libxl_conf.c
@@ -1737,15 +1737,12 @@ libxlMakeBuildInfoVfb(virPortAllocatorRa
/*
* Get domain0 autoballoon configuration. Honor user-specified
* setting in libxl.conf first. If not specified, autoballooning
- * is disabled when domain0's memory is set with 'dom0_mem'.
- * Otherwise autoballooning is enabled.
+ * is disabled.
*/
static int
libxlGetAutoballoonConf(libxlDriverConfigPtr cfg,
virConfPtr conf)
{
- g_autoptr(GRegex) regex = NULL;
- g_autoptr(GError) err = NULL;
int res;
res = virConfGetValueBool(conf, "autoballoon", &cfg->autoballoon);
@@ -1754,15 +1751,8 @@ libxlGetAutoballoonConf(libxlDriverConfi
else if (res == 1)
return 0;
- regex = g_regex_new("(^| )dom0_mem=((|min:|max:)[0-9]+[bBkKmMgG]?,?)+($| )",
- 0, 0, &err);
- if (!regex) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to compile regex %s"), err->message);
- return -1;
- }
-
- cfg->autoballoon = !g_regex_match(regex, cfg->verInfo->commandline, 0, NULL);
+ /* make it explicit */
+ cfg->autoballoon = 0;
return 0;
}