mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 01:43:23 +00:00
qemu: track 'cancelling' migration state
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>
This commit is contained in:
parent
72423df992
commit
e2660cb8a6
@ -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;
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user