mirror of
https://github.com/qemu/qemu.git
synced 2026-07-09 01:56:21 +00:00
Switchover-ack is a mechanism to synchronize between source and destination QEMU during migration to prevent the source from switching over prematurely. VFIO uses switchover-ack to ensure switchover happens only after destination side has loaded the precopy initial bytes. This is important for VFIO, as otherwise downtime could be impacted and be higher. In its current state, switchover-ack is a one-time mechanism, meaning that switchover is acked only once and past that another ACK cannot be requested again. This was sufficient until now, as VFIO precopy initial bytes was defined to be monotonically decreasing. Thus, when precopy initial bytes reached zero for all VFIO devices, a single ACK would be sent and its validity would hold. However, now the new VFIO_PRECOPY_INFO_REINIT feature allows precopy initial bytes to be re-initialized during precopy. Specifically, it means that initial bytes can grow after reaching zero, which would invalidate a previously sent switchover ACK. To solve this, make switchover-ack reusable and allow devices to request switchover ACKs when needed via the save_query_pending SaveVMHandler. Since now switchover ACK can be requested for a specific device and in different times, make switchover ACK per-device (instead of a single ACK for all devices) and let source side do the pending ACKs accounting. Keep the legacy switchover-ack mechanism for backward compatibility and turn it on by a compatibility property for older machines. Enable the property until VFIO implements the new switchover-ack. Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Avihai Horon <avihaih@nvidia.com> Link: https://lore.kernel.org/qemu-devel/20260706085211.13905-8-avihaih@nvidia.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
31 lines
667 B
C
31 lines
667 B
C
/*
|
|
* QEMU public migration capabilities
|
|
*
|
|
* Copyright (c) 2012-2023 Red Hat Inc
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*/
|
|
|
|
#ifndef QEMU_MIGRATION_CLIENT_OPTIONS_H
|
|
#define QEMU_MIGRATION_CLIENT_OPTIONS_H
|
|
|
|
|
|
/* properties */
|
|
bool migrate_send_switchover_start(void);
|
|
bool migrate_switchover_ack_legacy(void);
|
|
|
|
/* capabilities */
|
|
|
|
bool migrate_background_snapshot(void);
|
|
bool migrate_dirty_limit(void);
|
|
bool migrate_postcopy_ram(void);
|
|
bool migrate_switchover_ack(void);
|
|
|
|
/* parameters */
|
|
|
|
MigMode migrate_mode(void);
|
|
uint64_t migrate_vcpu_dirty_limit_period(void);
|
|
|
|
#endif
|