]> git.ipfire.org Git - thirdparty/libvirt.git/commit
libxl: fix reporting of maximum memory
authorJim Fehlig <jfehlig@suse.com>
Mon, 16 Jan 2017 17:51:40 +0000 (10:51 -0700)
committerJim Fehlig <jfehlig@suse.com>
Thu, 9 Feb 2017 16:38:34 +0000 (09:38 -0700)
commitd2b77608e9e9c23416a9ac93a50054348cb51653
tree078eab310f42e1a8874c0cf51b53a36c2c4062ab
parentbd1168101a0ea5efcf3b2dc5ee782af6ad911320
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>
src/libxl/libxl_driver.c