libvirt/src/libxl
Jim Fehlig 417197a38f libxl: Fix Domain-0 ballooning logic
When Domain-0 autoballooning is enabled, it's possible that memory may
need to be ballooned down in Domain-0 to accommodate the needs of another
virtual machine. libxlDomainFreeMemory handles this task, but due to a
logic bug is underflowing the variable containing Domain-0 new
target memory. The resulting huge numbers are filtered by
libxlSetMemoryTargetWrapper and memory is not changed.

Under the covers, libxlDomainFreeMemory uses Xen's libxl_set_memory_target
API, which includes a 'relative' parameter for specifying how to set the
target. If true, the target is an increment/decrement value over the
current memory, otherwise target is taken as an absolute value.
libxlDomainFreeMemory sets 'relative' to true, but never allows for
negative values by declaring the target memory variable as an unsigned.
Fix by declaring the variable as signed, which also requried adjusting
libxlSetMemoryTargetWrapper.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-09-19 09:56:29 -06:00
..
libvirtd_libxl.aug
libxl_api_wrapper.h libxl: Fix Domain-0 ballooning logic 2023-09-19 09:56:29 -06:00
libxl_capabilities.c lib: Finish using struct zero initializer manually 2023-08-03 16:41:19 +02:00
libxl_capabilities.h lib: Use G_NO_INLINE instead of G_GNUC_NO_INLINE 2022-07-18 17:23:15 +02:00
libxl_conf.c src: Avoid needless checks before calling g_strdup() 2023-09-18 14:46:24 +02:00
libxl_conf.h libxl: Remove unused includes 2022-06-16 06:43:56 +02:00
libxl_domain.c libxl: Fix Domain-0 ballooning logic 2023-09-19 09:56:29 -06:00
libxl_domain.h libxl: use virDomainObjEndJob() 2022-09-07 12:14:29 +02:00
libxl_driver.c virDomainHostdevSubsys: Convert 'type' field to proper enum type 2023-09-15 10:35:04 +02:00
libxl_driver.h
libxl_logger.c libxl: Remove unused includes 2022-06-16 06:43:56 +02:00
libxl_logger.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
libxl_migration.c libxl: Move error messages onto a single line 2023-09-04 09:35:36 +02:00
libxl_migration.h libxl: Advertise support for VIR_MIGRATE_CHANGE_PROTECTION 2023-07-13 08:28:50 -06:00
libxl.conf
meson.build meson: Add missing virt_install_dirs 2022-02-02 16:26:36 +01:00
test_libvirtd_libxl.aug.in
virtxend.init.in
virtxend.service.in src: remove After=local-fs.target from systemd units 2023-07-20 10:58:00 +01:00
xen_common.c libxl: Update format strings in translated messages 2023-04-01 11:40:33 +02:00
xen_common.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
xen_xl.c conf: add ability to configure a vdpa block disk device 2023-09-12 11:06:41 -05:00
xen_xl.h libxl: Remove unused includes 2022-06-16 06:43:56 +02:00
xen_xm.c conf: Don't default to raw format for loader/NVRAM 2023-08-21 13:51:34 +02:00
xen_xm.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
xenxs_private.h