SHA256
1
0
forked from pool/libvirt
libvirt/d2b77608-libxl-maxmem-fix.patch
James Fehlig f167ba3466 Accepting request 456194 from home:jfehlig:branches:Virtualization
- apparmor: don't fail on non-apparmor <seclabel>
  apparmor-errormsg-fix.patch, apparmor-alt-seclabel.patch
  bsc#1023436

- libxl: fix reporting of domain maximum memory
  ff225538-libxl-autoballoon-setting.patch,
  c89a6e78-libxl-physinfo-cleanup.patch,
  d2b77608-libxl-maxmem-fix.patch,
  79692c38-libxl-dom0-maxmem.patch
  bsc#1017762

- libxl: set disk format to raw if not specified and fix disk
  detach
  321a28c6-libxl-default-disk-format.patch,
  bd116810-libxl-fix-disk-detach.patch
  bsc#1003379

- libxl: fix timer configurations
  6e4759d0-libxl-timer-fix.patch,
  87df87e0-libxl-timer-tsc-emulate.patch,
  b4386fda-xenconfig-timer-fix.patch, d3970925-timer-tests.patch
  bsc#1019969

OBS-URL: https://build.opensuse.org/request/show/456194
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=583
2017-02-10 23:01:12 +00:00

58 lines
2.4 KiB
Diff

commit d2b77608e9e9c23416a9ac93a50054348cb51653
Author: Jim Fehlig <jfehlig@suse.com>
Date: Mon Jan 16 10:51:40 2017 -0700
libxl: fix reporting of maximum memory
The libxl driver reports different values of maximum memory depending
on state of a domain. If inactive, maximum memory value is reported
correctly. When active, maximum memory is derived from max_pages value
returned by the XEN_SYSCTL_getdomaininfolist sysctl operation. But
max_pages can be changed by toolstacks and does not necessarily
represent the maximum memory a domain can use during its active
lifetime.
A better location for determining a domain's maximum memory is the
/local/domain/<id>/memory/static-max node in xenstore. This value
is set from the libxl_domain_build_info.max_memkb field when creating
the domain. Currently it cannot be changed nor can its value be
exceeded by a balloon operation. From libvirt's perspective, always
reporting maximum memory with virDomainDefGetMemoryTotal() will produce
the same results as reading the static-max node in xenstore.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Index: libvirt-3.0.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-3.0.0.orig/src/libxl/libxl_driver.c
+++ libvirt-3.0.0/src/libxl/libxl_driver.c
@@ -1640,10 +1640,10 @@ libxlDomainGetInfo(virDomainPtr dom, vir
if (virDomainGetInfoEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
+ info->maxMem = virDomainDefGetMemoryTotal(vm->def);
if (!virDomainObjIsActive(vm)) {
info->cpuTime = 0;
info->memory = vm->def->mem.cur_balloon;
- info->maxMem = virDomainDefGetMemoryTotal(vm->def);
} else {
libxl_dominfo_init(&d_info);
@@ -1655,7 +1655,6 @@ libxlDomainGetInfo(virDomainPtr dom, vir
}
info->cpuTime = d_info.cpu_time;
info->memory = d_info.current_memkb;
- info->maxMem = d_info.max_memkb;
libxl_dominfo_dispose(&d_info);
}
@@ -5175,7 +5174,7 @@ libxlDomainMemoryStats(virDomainPtr dom,
goto endjob;
}
mem = d_info.current_memkb;
- maxmem = d_info.max_memkb;
+ maxmem = virDomainDefGetMemoryTotal(vm->def);
LIBXL_SET_MEMSTAT(VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON, mem);
LIBXL_SET_MEMSTAT(VIR_DOMAIN_MEMORY_STAT_AVAILABLE, maxmem);