]> xenbits.xensource.com Git - xen.git/commit
libxl: keep PoD target adjustment by memory fudge after reload_domain_config()
authorVitaly Kuznetsov <vkuznets@redhat.com>
Wed, 3 Feb 2016 15:53:03 +0000 (16:53 +0100)
committerWei Liu <wei.liu2@citrix.com>
Wed, 1 Jun 2016 16:26:33 +0000 (17:26 +0100)
commit7e81d992b183c47a74eea5ecd613d27950b5cdc3
tree5160342e67a9c31c42a11a8940388d317ff2a87f
parentf91c84edebe67296e4051af055dbf0adafb13a37
libxl: keep PoD target adjustment by memory fudge after reload_domain_config()

Commit 56fb5fd623 ("libxl: adjust PoD target by memory fudge, too")
introduced target_memkb adjustment for HVM PoD domains on create,
wherein the value it wrote to target is always 1MiB lower than the
actual target_memkb.  Unfortunately, on reboot, it is this value which
is read *unmodified* to feed into the next domain creation; from which
1MiB is subtracted *again*.  This means that any guest which reboots
with memory < maxmem will have its memory target decreased by 1MiB on
every boot.

This patch makes it so that when reading target on reboot, we adjust the
value we read *up* by 1MiB, so that the domain will be build with the
appropriate amount of memory and the target will remain the same after
reboot.

This is still not quite a complete fix, as the 1MiB offset is only
subtracted when creating or rebooting; it is not subtracted when 'xl
set-memory' is called.  But it will prevent any situations where memory
is continually increased or decreased.  A better fix will have to wait
until after the release.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl_dom.c
tools/libxl/libxl_internal.h