]> 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)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 26 Apr 2012 14:30:23 +0000 (16:30 +0200)
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 1bee66acfdac02f160d8265c254ca9026e4867a2..43e56b764239652cee7ab19b824c4b8b2def2552 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;