Since qemu upstream commit TBD [1] the memory size for numa nodes,
memory devices and the total size needs to be aligned to multiples of
256MiB. Otherwise qemu refuses to start with the following message:
qemu-kvm: Can't support memory configuration where RAM size 0x7d000000
or maxmem size 0x7d000000 isn't aligned to 256 MB
Change the alignment code to round sizes to 256 MiB multiples.
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1249006
----
[1] Since qemu is in freeze, the commit that introduces the problem
doesn't have a valid upstream commit ID yet.
https://github.com/dgibson/qemu/commit/456156ea4974eeff761d3fe7addc279f29...
---
src/qemu/qemu_domain.c | 9 ++++++++-
tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index c1b3326..aad912a 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3111,11 +3111,18 @@ qemuDomainAgentAvailable(virDomainObjPtr vm,
static unsigned long long
-qemuDomainGetMemorySizeAlignment(virDomainDefPtr def ATTRIBUTE_UNUSED)
+qemuDomainGetMemorySizeAlignment(virDomainDefPtr def)
{
/* Align memory size. QEMU requires rounding to next 4KiB block.
* We'll take the "traditional" path and round it to 1MiB*/
+ /* pseries aligns memory to 256MiB chunks */
+ if ((ARCH_IS_PPC64(def->os.arch) &&
+ def->os.machine &&
+ STRPREFIX(def->os.machine, "pseries"))) {
+ return 256 * 1024;
+ }
+
return 1024;
}
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args
b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args
index 64df406..305e924 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-compat.args
@@ -1,7 +1,7 @@
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
QEMU_AUDIO_DRV=none /usr/bin/qemu-system-ppc64 -S -M pseries \
-cpu host,compat=power7 \
--m 214 -smp 4 -nographic -nodefconfig -nodefaults \
+-m 256 -smp 4 -nographic -nodefconfig -nodefaults \
-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c -usb \
-chardev pty,id=charserial0 \
--
2.4.5