7a3408
From f03a1cb15b60d56f8f85bcd4a9823aac68682d56 Mon Sep 17 00:00:00 2001
7a3408
Message-Id: <f03a1cb15b60d56f8f85bcd4a9823aac68682d56@dist-git>
7a3408
From: Peter Krempa <pkrempa@redhat.com>
7a3408
Date: Tue, 22 Sep 2015 16:59:46 +0200
7a3408
Subject: [PATCH] qemu: command: Align memory sizes only on fresh starts
7a3408
7a3408
When we are starting a qemu process for an incomming migration or
7a3408
snapshot reloading we should not modify the memory sizes in the domain
7a3408
since we could potentially change the guest ABI that was tediously
7a3408
checked before. Additionally the function now updates the initial memory
7a3408
size according to the NUMA node size, which should not happen if we are
7a3408
restoring state.
7a3408
7a3408
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1252685
7a3408
(cherry picked from commit c7d7ba85a6242d789ba3f4dae313e950fbb638c5)
7a3408
7a3408
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7a3408
---
7a3408
 src/qemu/qemu_command.c                             | 3 ++-
7a3408
 tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args | 2 +-
7a3408
 2 files changed, 3 insertions(+), 2 deletions(-)
7a3408
7a3408
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
7a3408
index 701ccc3..6314976 100644
7a3408
--- a/src/qemu/qemu_command.c
7a3408
+++ b/src/qemu/qemu_command.c
7a3408
@@ -9040,7 +9040,8 @@ qemuBuildCommandLine(virConnectPtr conn,
7a3408
     if (qemuBuildDomainLoaderCommandLine(cmd, def, qemuCaps) < 0)
7a3408
         goto error;
7a3408
 
7a3408
-    if (qemuDomainAlignMemorySizes(def) < 0)
7a3408
+    if (!migrateFrom && !snapshot &&
7a3408
+        qemuDomainAlignMemorySizes(def) < 0)
7a3408
         goto error;
7a3408
 
7a3408
     virCommandAddArg(cmd, "-m");
7a3408
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args b/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args
7a3408
index 5c67702..458c015 100644
7a3408
--- a/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args
7a3408
+++ b/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.args
7a3408
@@ -1,5 +1,5 @@
7a3408
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
7a3408
 /usr/bin/qemu -S -M \
7a3408
-pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
7a3408
+pc -m 213 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
7a3408
 -no-acpi -boot c -usb -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel \
7a3408
 none -incoming stdio
7a3408
-- 
7a3408
2.5.3
7a3408