]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_validate.c: add pSeries NVDIMM size alignment validation
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Thu, 30 Jul 2020 19:48:01 +0000 (16:48 -0300)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 24 Aug 2020 16:41:28 +0000 (18:41 +0200)
commit0ccceaa57c50e5ee528f7073fa8723afd62b88b7
tree2e2ed240bb7af0b126b831b62820cb918cafe04e
parent4fa2202d884414ad34d9952e72fb39b1d93c7e14
qemu_validate.c: add pSeries NVDIMM size alignment validation

The existing auto-align behavior for pSeries has the idea to
alleviate user configuration of the NVDIMM size, given that the
alignment calculation is not trivial to do (256MiB alignment
of mem->size - mem->label_size value, a.k.a guest area). We
align mem->size down to avoid end of file problems.

The end result is not ideal though. We do not touch the domain
XML, meaning that the XML can report a NVDIMM size 255MiB smaller
than the actual size the guest is seeing. It also adds one more
thing to consider in case the guest is reporting less memory
than declared, since the auto-align is transparent to the
user.

Following Andrea's suggestion in [1], let's instead do an
size alignment validation. If the NVDIMM is unaligned, error out
and suggest a rounded up value. This can be bothersome to users,
but will bring consistency of NVDIMM size between the domain XML
and the guest.

This approach will force existing non-running pSeries guests to
readjust the NVDIMM value in their XMLs, if necessary. No changes
were made for x86 NVDIMM support.

[1] https://www.redhat.com/archives/libvir-list/2020-July/msg01471.html

Suggested-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_validate.c
tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.ppc64-latest.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.xml
tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.xml