]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Set correct job status when qemuMigrationRun fails
authorJiri Denemark <jdenemar@redhat.com>
Thu, 19 Oct 2017 12:26:24 +0000 (14:26 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 23 Oct 2017 08:08:29 +0000 (10:08 +0200)
Instead of enumerating all states which need to be turned into
QEMU_DOMAIN_JOB_STATUS_FAILED (and failing to add all of them), it's
better to mention just the one which needs to be left alone.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_migration.c

index bcb0e2a987965548dc17c7cd9c5d9b72ed0c1c59..626b4e3eedef86042ac41a9c2d98e905456bdddf 100644 (file)
@@ -3943,9 +3943,7 @@ qemuMigrationRun(virQEMUDriverPtr driver,
     if (iothread)
         qemuMigrationStopTunnel(iothread, true);
 
-    if (priv->job.current->status == QEMU_DOMAIN_JOB_STATUS_ACTIVE ||
-        priv->job.current->status == QEMU_DOMAIN_JOB_STATUS_MIGRATING ||
-        priv->job.current->status == QEMU_DOMAIN_JOB_STATUS_POSTCOPY)
+    if (priv->job.current->status != QEMU_DOMAIN_JOB_STATUS_CANCELED)
         priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_FAILED;
 
     goto cleanup;