]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fix detection of failed migration
authorJiri Denemark <jdenemar@redhat.com>
Fri, 20 Apr 2012 15:10:37 +0000 (17:10 +0200)
committerCole Robinson <crobinso@redhat.com>
Thu, 26 Apr 2012 18:15:35 +0000 (14:15 -0400)
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.

src/qemu/qemu_migration.c

index 85907a6ee3bfe896e3394b3743837ff0637bf82d..ecf81585e612e1b1a035375875f4f76fbd7129ff 100644 (file)
@@ -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;