After a successful cpr-luo migration, the source QEMU remains paused and
keeps the LUO session open for the upcoming kexec. If the user instead
resumes the source QEMU with the cont command, close the LUO session
before restarting the VM.

Signed-off-by: Dongli Zhang <[email protected]>
---
 monitor/qmp-cmds.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index 7525a88e04..fc66618c47 100644
--- a/monitor/qmp-cmds.c
+++ b/monitor/qmp-cmds.c
@@ -32,6 +32,7 @@
 #include "qapi/type-helpers.h"
 #include "hw/mem/memory-device.h"
 #include "hw/intc/intc.h"
+#include "migration/cpr.h"
 #include "migration/misc.h"
 
 NameInfo *qmp_query_name(Error **errp)
@@ -113,6 +114,12 @@ void qmp_cont(Error **errp)
             error_propagate(errp, local_err);
             return;
         }
+        /*
+         * If the user resumes the source QEMU after a completed cpr-luo
+         * migration, close the LUO session fd. This is a nop for other
+         * migration modes or regular operation.
+         */
+        cpr_luo_abort();
         vm_start();
     }
 }
-- 
2.43.5


Reply via email to