qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH 19/26] migration: Don't sync vcpus when migrating confidentia


From: Dov Murik
Subject: [RFC PATCH 19/26] migration: Don't sync vcpus when migrating confidential guests
Date: Tue, 2 Mar 2021 15:48:15 -0500

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 --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);
-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]