From: Peter Krempa Date: Wed, 23 Sep 2015 12:19:06 +0000 (+0200) Subject: qemu: Refresh memory size only on fresh starts X-Git-Tag: v1.2.18.2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c22a4bb52325ead4e6330543d91e6463fe580d72;p=thirdparty%2Flibvirt.git qemu: Refresh memory size only on fresh starts Qemu unfortunately doesn't update internal state right after migration and so the actual balloon size as returned by 'query-balloon' are invalid for a while after the CPUs are started after migration. If we'd refresh our internal state at this point we would report invalid current memory size until the next balloon event would arrive. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1242940 (cherry picked from commit d7a0386e229176ec67531aac1412b8a98914da8e) --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 694c5cd65b..c896c6c75b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5015,7 +5015,8 @@ int qemuProcessStart(virConnectPtr conn, /* Since CPUs were not started yet, the balloon could not return the memory * to the host and thus cur_balloon needs to be updated so that GetXMLdesc * and friends return the correct size in case they can't grab the job */ - if (qemuProcessRefreshBalloonState(driver, vm, asyncJob) < 0) + if (!migrateFrom && !snapshot && + qemuProcessRefreshBalloonState(driver, vm, asyncJob) < 0) goto cleanup; VIR_DEBUG("Detecting actual memory size for video device");