From 1b4adb10f89802e41f730b3d2b5d85a551c6bce5 Mon Sep 17 00:00:00 2001 From: Avihai Horon Date: Wed, 21 Jun 2023 14:11:55 +0300 Subject: migration: Implement switchover ack logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement switchover ack logic. This prevents the source from stopping the VM and completing the migration until an ACK is received from the destination that it's OK to do so. To achieve this, a new SaveVMHandlers handler switchover_ack_needed() and a new return path message MIG_RP_MSG_SWITCHOVER_ACK are added. The switchover_ack_needed() handler is called during migration setup in the destination to check if switchover ack is used by the migrated device. When switchover is approved by all migrated devices in the destination that support this capability, the MIG_RP_MSG_SWITCHOVER_ACK return path message is sent to the source to notify it that it's OK to do switchover. Signed-off-by: Avihai Horon Reviewed-by: Peter Xu Tested-by: YangHang Liu Acked-by: Alex Williamson Signed-off-by: Cédric Le Goater --- include/migration/register.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/migration') diff --git a/include/migration/register.h b/include/migration/register.h index a8dfd8f..90914f3 100644 --- a/include/migration/register.h +++ b/include/migration/register.h @@ -71,6 +71,8 @@ typedef struct SaveVMHandlers { int (*load_cleanup)(void *opaque); /* Called when postcopy migration wants to resume from failure */ int (*resume_prepare)(MigrationState *s, void *opaque); + /* Checks if switchover ack should be used. Called only in dest */ + bool (*switchover_ack_needed)(void *opaque); } SaveVMHandlers; int register_savevm_live(const char *idstr, -- cgit v1.1