Blame SOURCES/kvm-migration-migrate-continue.patch

4a2fec
From d6a77c209ff177aef13b9a52277a80c855b72c27 Mon Sep 17 00:00:00 2001
4a2fec
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
4a2fec
Date: Wed, 25 Oct 2017 18:28:35 +0200
4a2fec
Subject: [PATCH 16/19] migration: migrate-continue
4a2fec
4a2fec
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
4a2fec
Message-id: <20171025182838.31829-5-dgilbert@redhat.com>
4a2fec
Patchwork-id: 77437
4a2fec
O-Subject: [RHV-7.5 qemu-kvm-rhev PATCH 4/7] migration: migrate-continue
4a2fec
Bugzilla: 1497120
4a2fec
RH-Acked-by: Peter Xu <peterx@redhat.com>
4a2fec
RH-Acked-by: Juan Quintela <quintela@redhat.com>
4a2fec
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
4a2fec
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
4a2fec
4a2fec
A new qmp command allows the caller to continue from a given
4a2fec
paused state.
4a2fec
4a2fec
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
4a2fec
Reviewed-by: Peter Xu <peterx@redhat.com>
4a2fec
Reviewed-by: Juan Quintela <quintela@redhat.com>
4a2fec
Signed-off-by: Juan Quintela <quintela@redhat.com>
4a2fec
(cherry picked from commit 89cfc02cb6e3fdaf8ae246493ea51e75be2818c1)
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
4a2fec
Conflicts:
4a2fec
	qapi/migration.json
4a2fec
          still in qapi-schema.json
4a2fec
        migration/migration.c
4a2fec
          use MigrationState_lookup[] rather than new _str() function
4a2fec
---
4a2fec
 migration/migration.c | 11 +++++++++++
4a2fec
 qapi-schema.json      | 17 +++++++++++++++++
4a2fec
 2 files changed, 28 insertions(+)
4a2fec
4a2fec
diff --git a/migration/migration.c b/migration/migration.c
4a2fec
index 436e122..3a1dabb 100644
4a2fec
--- a/migration/migration.c
4a2fec
+++ b/migration/migration.c
4a2fec
@@ -1287,6 +1287,17 @@ void qmp_migrate_cancel(Error **errp)
4a2fec
     migrate_fd_cancel(migrate_get_current());
4a2fec
 }
4a2fec
 
4a2fec
+void qmp_migrate_continue(MigrationStatus state, Error **errp)
4a2fec
+{
4a2fec
+    MigrationState *s = migrate_get_current();
4a2fec
+    if (s->state != state) {
4a2fec
+        error_setg(errp,  "Migration not in expected state: %s",
4a2fec
+                   MigrationStatus_lookup[s->state]);
4a2fec
+        return;
4a2fec
+    }
4a2fec
+    qemu_sem_post(&s->pause_sem);
4a2fec
+}
4a2fec
+
4a2fec
 void qmp_migrate_set_cache_size(int64_t value, Error **errp)
4a2fec
 {
4a2fec
     MigrationState *s = migrate_get_current();
4a2fec
diff --git a/qapi-schema.json b/qapi-schema.json
4a2fec
index de8c611..cd528c8 100644
4a2fec
--- a/qapi-schema.json
4a2fec
+++ b/qapi-schema.json
4a2fec
@@ -2837,6 +2837,23 @@
4a2fec
 { 'command': 'migrate_cancel' }
4a2fec
 
4a2fec
 ##
4a2fec
+# @migrate-continue:
4a2fec
+#
4a2fec
+# Continue migration when it's in a paused state.
4a2fec
+#
4a2fec
+# @state: The state the migration is currently expected to be in
4a2fec
+#
4a2fec
+# Returns: nothing on success
4a2fec
+# Since: 2.11
4a2fec
+# Example:
4a2fec
+#
4a2fec
+# -> { "execute": "migrate-continue" , "arguments":
4a2fec
+#      { "state": "pre-switchover" } }
4a2fec
+# <- { "return": {} }
4a2fec
+##
4a2fec
+{ 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} }
4a2fec
+
4a2fec
+##
4a2fec
 # @migrate_set_downtime:
4a2fec
 #
4a2fec
 # Set maximum tolerated downtime for migration.
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec