Re: [PATCH] libxl: Fix Domain-0 ballooning logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/18/23 19:16, Jim Fehlig wrote:
> 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@xxxxxxxx>
> ---
>  src/libxl/libxl_api_wrapper.h | 16 ++++++----------
>  src/libxl/libxl_domain.c      |  2 +-
>  2 files changed, 7 insertions(+), 11 deletions(-)

Reviewed-by: Michal Privoznik <mprivozn@xxxxxxxxxx>

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux