[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 09/12] migration: Add QMP command start-migration-handler
From: |
Dov Murik |
Subject: |
[RFC PATCH v2 09/12] migration: Add QMP command start-migration-handler |
Date: |
Mon, 23 Aug 2021 10:16:33 -0400 |
The start-migration-handler QMP command starts the mirror vcpu directly
at the migration handler entry point.
This is a temporary workaround to start-up (resume) the mirror vcpu
which runs the in-guest migration handler (both on the source and the
target).
A proper solution would be to start it automatically when the 'migrate'
and 'migrate-incoming' QMP commands are executed.
Signed-off-by: Dov Murik <dovmurik@linux.ibm.com>
---
qapi/migration.json | 12 ++++++++++++
migration/migration.c | 12 ++++++++++++
2 files changed, 24 insertions(+)
diff --git a/qapi/migration.json b/qapi/migration.json
index 69c615ec4d..baff3c6bf7 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1504,6 +1504,18 @@
##
{ 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
+##
+# @start-migration-handler:
+#
+# Start the mirror vcpu which runs the in-guest migration handler.
+#
+# Returns: nothing on success
+#
+# Since: 6.2
+#
+##
+{ 'command': 'start-migration-handler' }
+
##
# @xen-save-devices-state:
#
diff --git a/migration/migration.c b/migration/migration.c
index c9bc33fb10..a9f3a79e4f 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -60,6 +60,7 @@
#include "qemu/yank.h"
#include "sysemu/cpus.h"
#include "yank_functions.h"
+#include "confidential-ram.h"
#define MAX_THROTTLE (128 << 20) /* Migration transfer speed throttling
*/
@@ -2161,6 +2162,17 @@ void qmp_migrate_incoming(const char *uri, Error **errp)
once = false;
}
+void qmp_start_migration_handler(Error **errp)
+{
+ CPUState *cpu;
+ CPU_FOREACH(cpu) {
+ if (cpu->mirror_vcpu) {
+ cgs_mh_reset_mirror_vcpu(cpu);
+ cpu_resume(cpu);
+ }
+ }
+}
+
void qmp_migrate_recover(const char *uri, Error **errp)
{
MigrationIncomingState *mis = migration_incoming_get_current();
--
2.20.1
- [RFC PATCH v2 00/12] Confidential guest-assisted live migration, Dov Murik, 2021/08/23
- [RFC PATCH v2 03/12] migration: Introduce gpa_inside_migration_helper_shared_area, Dov Murik, 2021/08/23
- [RFC PATCH v2 02/12] migration: Add helpers to load confidential RAM, Dov Murik, 2021/08/23
- [RFC PATCH v2 06/12] migration: Skip ROM, non-RAM, and vga.vram memory region during RAM migration, Dov Murik, 2021/08/23
- [RFC PATCH v2 10/12] migration: Add start-migrate-incoming QMP command, Dov Murik, 2021/08/23
- [RFC PATCH v2 05/12] migration: Load confidential guest RAM using migration helper, Dov Murik, 2021/08/23
- [RFC PATCH v2 09/12] migration: Add QMP command start-migration-handler,
Dov Murik <=
- [RFC PATCH v2 07/12] i386/kvm: Exclude mirror vcpu in kvm_synchronize_all_tsc, Dov Murik, 2021/08/23
- [RFC PATCH v2 04/12] migration: Save confidential guest RAM using migration helper, Dov Murik, 2021/08/23
- [RFC PATCH v2 08/12] migration: Allow resetting the mirror vcpu to the MH entry point, Dov Murik, 2021/08/23
- [RFC PATCH v2 01/12] migration: Add helpers to save confidential RAM, Dov Murik, 2021/08/23
- [RFC PATCH v2 12/12] docs: Add confidential guest live migration documentation, Dov Murik, 2021/08/23
- [RFC PATCH v2 11/12] hw/isa/lpc_ich9: Allow updating an already-running VM, Dov Murik, 2021/08/23