aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAvihai Horon <avihaih@nvidia.com>2023-06-21 14:11:55 +0300
committerCédric Le Goater <clg@redhat.com>2023-06-30 06:02:51 +0200
commit1b4adb10f89802e41f730b3d2b5d85a551c6bce5 (patch)
tree881d3a342f46ebb714cf3ddd466deee18ac0cd4f /include
parent6574232fff6a810e1882c98aa7dcf23d6afe9a31 (diff)
downloadqemu-1b4adb10f89802e41f730b3d2b5d85a551c6bce5.zip
qemu-1b4adb10f89802e41f730b3d2b5d85a551c6bce5.tar.gz
qemu-1b4adb10f89802e41f730b3d2b5d85a551c6bce5.tar.bz2
migration: Implement switchover ack logic
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 <avihaih@nvidia.com> Reviewed-by: Peter Xu <peterx@redhat.com> Tested-by: YangHang Liu <yanghliu@redhat.com> Acked-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/migration/register.h2
1 files changed, 2 insertions, 0 deletions
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,