From: Jiri Denemark Date: Fri, 20 Apr 2012 15:10:37 +0000 (+0200) Subject: qemu: Fix detection of failed migration X-Git-Tag: v0.9.12-rc1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25a63451ad4ff1a211bdb33b2b9c7e3efc2b8b90;p=thirdparty%2Flibvirt.git qemu: Fix detection of failed migration When QEMU reported failed or canceled migration, we correctly detected it but didn't really consider it as an error condition and migration protocol just went on. Luckily, some of the subsequent steps eventually failed end we reported an (unrelated and mostly random) error back to the caller. --- diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 1bee66acfd..43e56b7642 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -882,7 +882,7 @@ qemuMigrationUpdateJobStatus(struct qemud_driver *driver, enum qemuDomainAsyncJob asyncJob) { qemuDomainObjPrivatePtr priv = vm->privateData; - int ret = -1; + int ret; int status; unsigned long long memProcessed; unsigned long long memRemaining; @@ -906,6 +906,7 @@ qemuMigrationUpdateJobStatus(struct qemud_driver *driver, } priv->job.info.timeElapsed -= priv->job.start; + ret = -1; switch (status) { case QEMU_MONITOR_MIGRATION_STATUS_INACTIVE: priv->job.info.type = VIR_DOMAIN_JOB_NONE;