Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:FrontRunner
libvirt
suse-libxl-disable-autoballoon.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File suse-libxl-disable-autoballoon.patch of Package libvirt
From 04708223cffedf65bd1d9e9651b03ebd22ad100c Mon Sep 17 00:00:00 2001 From: Jim Fehlig <jfehlig@suse.com> Date: Mon, 27 Jun 2022 16:39:42 -0600 Subject: 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. Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/libxl/libxl.conf | 9 ++++----- src/libxl/libxl_conf.c | 16 +++------------- src/libxl/test_libvirtd_libxl.aug.in | 2 +- 3 files changed, 8 insertions(+), 19 deletions(-) Index: libvirt-8.0.0/src/libxl/libxl.conf =================================================================== --- libvirt-8.0.0.orig/src/libxl/libxl.conf +++ libvirt-8.0.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-8.0.0/src/libxl/libxl_conf.c =================================================================== --- libvirt-8.0.0.orig/src/libxl/libxl_conf.c +++ libvirt-8.0.0/src/libxl/libxl_conf.c @@ -1746,15 +1746,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(libxlDriverConfig *cfg, virConf *conf) { - g_autoptr(GRegex) regex = NULL; - g_autoptr(GError) err = NULL; int res; res = virConfGetValueBool(conf, "autoballoon", &cfg->autoballoon); @@ -1763,15 +1760,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; } Index: libvirt-8.0.0/src/libxl/test_libvirtd_libxl.aug.in =================================================================== --- libvirt-8.0.0.orig/src/libxl/test_libvirtd_libxl.aug.in +++ libvirt-8.0.0/src/libxl/test_libvirtd_libxl.aug.in @@ -2,7 +2,7 @@ module Test_libvirtd_libxl = @CONFIG@ test Libvirtd_libxl.lns get conf = -{ "autoballoon" = "1" } +{ "autoballoon" = "0" } { "lock_manager" = "lockd" } { "keepalive_interval" = "5" } { "keepalive_count" = "5" }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor