From 7d98216efe37db465e3819912a014086e33c3bdd Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Wed, 25 Oct 2017 18:28:33 +0200 Subject: [PATCH 14/19] migration: Add 'pre-switchover' and 'device' statuses RH-Author: Dr. David Alan Gilbert Message-id: <20171025182838.31829-3-dgilbert@redhat.com> Patchwork-id: 77436 O-Subject: [RHV-7.5 qemu-kvm-rhev PATCH 2/7] migration: Add 'pre-switchover' and 'device' statuses Bugzilla: 1497120 RH-Acked-by: Peter Xu RH-Acked-by: Juan Quintela RH-Acked-by: Miroslav Rezanina From: "Dr. David Alan Gilbert" Add two statuses for use when the 'pause-before-switchover' capability is enabled. 'pre-switchover' is the state that we wait in for management to allow us to continue. 'device' is the state we enter while serialising the devices after management gives us the OK. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela (cherry picked from commit 31e060774cf5c3b9945f6f16d6c18d6eae18e4d9) Signed-off-by: Miroslav Rezanina Conflicts: qapi/migration.json still in qapi-schema.json --- migration/migration.c | 6 ++++++ qapi-schema.json | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index d4356a4..54db29f 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -473,6 +473,8 @@ static bool migration_is_setup_or_active(int state) case MIGRATION_STATUS_ACTIVE: case MIGRATION_STATUS_POSTCOPY_ACTIVE: case MIGRATION_STATUS_SETUP: + case MIGRATION_STATUS_PRE_SWITCHOVER: + case MIGRATION_STATUS_DEVICE: return true; default: @@ -547,6 +549,8 @@ MigrationInfo *qmp_query_migrate(Error **errp) case MIGRATION_STATUS_ACTIVE: case MIGRATION_STATUS_CANCELLING: case MIGRATION_STATUS_POSTCOPY_ACTIVE: + case MIGRATION_STATUS_PRE_SWITCHOVER: + case MIGRATION_STATUS_DEVICE: /* TODO add some postcopy stats */ info->has_status = true; info->has_total_time = true; @@ -1102,6 +1106,8 @@ bool migration_is_idle(void) case MIGRATION_STATUS_ACTIVE: case MIGRATION_STATUS_POSTCOPY_ACTIVE: case MIGRATION_STATUS_COLO: + case MIGRATION_STATUS_PRE_SWITCHOVER: + case MIGRATION_STATUS_DEVICE: return false; case MIGRATION_STATUS__MAX: g_assert_not_reached(); diff --git a/qapi-schema.json b/qapi-schema.json index 9b9ec9a..de8c611 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -674,12 +674,18 @@ # @colo: VM is in the process of fault tolerance, VM can not get into this # state unless colo capability is enabled for migration. (since 2.8) # +# @pre-switchover: Paused before device serialisation. (since 2.11) +# +# @device: During device serialisation when pause-before-switchover is enabled +# (since 2.11) +# # Since: 2.3 # ## { 'enum': 'MigrationStatus', 'data': [ 'none', 'setup', 'cancelling', 'cancelled', - 'active', 'postcopy-active', 'completed', 'failed', 'colo' ] } + 'active', 'postcopy-active', 'completed', 'failed', 'colo', + 'pre-switchover', 'device' ] } ## # @MigrationInfo: -- 1.8.3.1