]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: track 'cancelling' migration state
authorEric Blake <eblake@redhat.com>
Fri, 6 Mar 2015 16:30:14 +0000 (09:30 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 18 Mar 2015 20:59:34 +0000 (14:59 -0600)
In qemu 2.3, the migration status will include 'cancelling' in the
window between when an asynchronous cancel has been requested and
when the migration is actually halted.  Previously, qemu hid this
state and reported 'active'.  Libvirt manages the sequence okay
even when the string is unrecognized (that is, it will report an
unknown state:

Migration: [ 69 %]^Cerror: internal error: unexpected migration status in cancelling.

but the migration is still cancelled), but recognizing the string
makes for a smoother user experience.

* src/qemu/qemu_monitor.h
(QEMU_MONITOR_MIGRATION_STATUS_CANCELLING): Add enum.
* src/qemu/qemu_monitor.c (qemuMonitorMigrationStatus): Map it.
* src/qemu/qemu_migration.c (qemuMigrationUpdateJobStatus): Adjust
clients.
* src/qemu/qemu_monitor_json.c
(qemuMonitorJSONGetMigrationStatusReply): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_migration.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c

index 992e19218ac651ced09c618ed8c436f7289aa46c..5b8160f96191954b437b14f432c6883fcafb9dbb 100644 (file)
@@ -2298,6 +2298,7 @@ qemuMigrationUpdateJobStatus(virQEMUDriverPtr driver,
         /* fall through */
     case QEMU_MONITOR_MIGRATION_STATUS_SETUP:
     case QEMU_MONITOR_MIGRATION_STATUS_ACTIVE:
+    case QEMU_MONITOR_MIGRATION_STATUS_CANCELLING:
         ret = 0;
         break;
 
index e0a9fe9b3a989af67c81b9617ee5cd88f2687636..5d39ce8caf74003349a23c324a85d12f206a2baa 100644 (file)
@@ -117,7 +117,8 @@ VIR_ONCE_GLOBAL_INIT(qemuMonitor)
 
 VIR_ENUM_IMPL(qemuMonitorMigrationStatus,
               QEMU_MONITOR_MIGRATION_STATUS_LAST,
-              "inactive", "active", "completed", "failed", "cancelled", "setup")
+              "inactive", "active", "completed", "failed", "cancelling",
+              "cancelled", "setup")
 
 VIR_ENUM_IMPL(qemuMonitorMigrationCaps,
               QEMU_MONITOR_MIGRATION_CAPS_LAST,
index e67d80098ec8021d52c2d91259a94ed66bbc841a..79ebd937ec864049440f9e6b0c47b28cb3376145 100644 (file)
@@ -441,6 +441,7 @@ enum {
     QEMU_MONITOR_MIGRATION_STATUS_ACTIVE,
     QEMU_MONITOR_MIGRATION_STATUS_COMPLETED,
     QEMU_MONITOR_MIGRATION_STATUS_ERROR,
+    QEMU_MONITOR_MIGRATION_STATUS_CANCELLING,
     QEMU_MONITOR_MIGRATION_STATUS_CANCELLED,
     QEMU_MONITOR_MIGRATION_STATUS_SETUP,
 
index 8994d5a30867535e8c1fc1f650c86478837eb2c8..6fe313f3184e349b70b11c7b632197c2e3f93095 100644 (file)
@@ -2518,6 +2518,7 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply,
         status->setup_time_set = true;
 
     if (status->status == QEMU_MONITOR_MIGRATION_STATUS_ACTIVE ||
+        status->status == QEMU_MONITOR_MIGRATION_STATUS_CANCELLING ||
         status->status == QEMU_MONITOR_MIGRATION_STATUS_COMPLETED) {
         virJSONValuePtr ram = virJSONValueObjectGet(ret, "ram");
         if (!ram) {