]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuDomainSetMemoryFlags: Take virtio-mem into consideration
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 16 Mar 2021 18:09:27 +0000 (19:09 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 1 Oct 2021 09:05:02 +0000 (11:05 +0200)
commitb1c3b5dfecaa37742e30bde00d9d230131e39f83
tree02b61a77174ff999b4322c7cdfb78fe95b20108b
parent51f65e952235608bc533e2ee669b224a319a4642
qemuDomainSetMemoryFlags: Take virtio-mem into consideration

The qemuDomainSetMemoryFlags() allows for memballoon
(<currentMemory/>) changes for both active and inactive guests.
And just before doing any change, we have to make sure that the
new size is not greater than the total memory (<memory/>).

However, the total memory includes not only the regular guest
memory, but also sum of maximum sizes of all virtio-mems (in fact
all memory devices for that matter). But virtio-mem devices are
modified differently (via virDomainUpdateDevice()) and thus the
upper limit for new balloon size has to be lowered.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c