diff mbox series

[RFC,19/26] migration: Don't sync vcpus when migrating confidential guests

Message ID 20210302204822.81901-20-dovmurik@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show
Series Confidential guest live migration | expand

Commit Message

Dov Murik March 2, 2021, 8:48 p.m. UTC
When loading incoming VM state to the migration target, don't sync the
vcpus because it'll prevent the migration handler to keep running.

Signed-off-by: Dov Murik <dovmurik@linux.vnet.ibm.com>
---
 migration/savevm.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/migration/savevm.c b/migration/savevm.c
index 52e2d72e4b..c5252612c3 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2673,6 +2673,13 @@  out:
     return ret;
 }
 
+static inline bool confidential_guest(void)
+{
+    MachineState *ms = MACHINE(qdev_get_machine());
+
+    return ms->cgs;
+}
+
 int qemu_loadvm_state(QEMUFile *f)
 {
     MigrationIncomingState *mis = migration_incoming_get_current();
@@ -2693,7 +2700,9 @@  int qemu_loadvm_state(QEMUFile *f)
         return -EINVAL;
     }
 
-    cpu_synchronize_all_pre_loadvm();
+    if (!confidential_guest()) {
+        cpu_synchronize_all_pre_loadvm();
+    }
 
     ret = qemu_loadvm_state_main(f, mis);
     qemu_event_set(&mis->main_thread_load_event);