[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/25] migration/multifd: Fix compat with QEMU < 9.0
From: |
Fabiano Rosas |
Subject: |
[PULL 09/25] migration/multifd: Fix compat with QEMU < 9.0 |
Date: |
Fri, 10 Jan 2025 09:13:57 -0300 |
Commit f5f48a7891 ("migration/multifd: Separate SYNC request with
normal jobs") changed the multifd source side to stop sending data
along with the MULTIFD_FLAG_SYNC, effectively introducing the concept
of a SYNC-only packet. Relying on that, commit d7e58f412c
("migration/multifd: Don't send ram data during SYNC") later came
along and skipped reading data from SYNC packets.
In a versions timeline like this:
8.2 f5f48a7 9.0 9.1 d7e58f41 9.2
The issue arises that QEMUs < 9.0 still send data along with SYNC, but
QEMUs > 9.1 don't gather that data anymore. This leads to various
kinds of migration failures due to desync/missing data.
Stop checking for a SYNC packet on the destination and unconditionally
unfill the packet.
>From now on:
old -> new:
the source sends data + sync, destination reads normally
new -> new:
source sends only sync, destination reads zeros
new -> old:
source sends only sync, destination reads zeros
CC: qemu-stable@nongnu.org
Fixes: d7e58f412c ("migration/multifd: Don't send ram data during SYNC")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2720
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Message-Id: <20241213160120.23880-2-farosas@suse.de>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
migration/multifd.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/migration/multifd.c b/migration/multifd.c
index 64e0ac2488..ab73d6d984 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -252,9 +252,8 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p,
Error **errp)
p->packet_num = be64_to_cpu(packet->packet_num);
p->packets_recved++;
- if (!(p->flags & MULTIFD_FLAG_SYNC)) {
- ret = multifd_ram_unfill_packet(p, errp);
- }
+ /* Always unfill, old QEMUs (<9.0) send data along with SYNC */
+ ret = multifd_ram_unfill_packet(p, errp);
trace_multifd_recv_unfill(p->id, p->packet_num, p->flags,
p->next_packet_size);
@@ -1156,9 +1155,13 @@ static void *multifd_recv_thread(void *opaque)
flags = p->flags;
/* recv methods don't know how to handle the SYNC flag */
p->flags &= ~MULTIFD_FLAG_SYNC;
- if (!(flags & MULTIFD_FLAG_SYNC)) {
- has_data = p->normal_num || p->zero_num;
- }
+
+ /*
+ * Even if it's a SYNC packet, this needs to be set
+ * because older QEMUs (<9.0) still send data along with
+ * the SYNC packet.
+ */
+ has_data = p->normal_num || p->zero_num;
qemu_mutex_unlock(&p->mutex);
} else {
/*
--
2.35.3
- [PULL 00/25] Migration patches for 2025-01-10, Fabiano Rosas, 2025/01/10
- [PULL 01/25] migration/multifd: Fix compile error caused by page_size usage, Fabiano Rosas, 2025/01/10
- [PULL 02/25] migration/multifd: Further remove the SYNC on complete, Fabiano Rosas, 2025/01/10
- [PULL 03/25] migration/multifd: Allow to sync with sender threads only, Fabiano Rosas, 2025/01/10
- [PULL 04/25] migration/ram: Move RAM_SAVE_FLAG* into ram.h, Fabiano Rosas, 2025/01/10
- [PULL 05/25] migration/multifd: Unify RAM_SAVE_FLAG_MULTIFD_FLUSH messages, Fabiano Rosas, 2025/01/10
- [PULL 06/25] migration/multifd: Remove sync processing on postcopy, Fabiano Rosas, 2025/01/10
- [PULL 07/25] migration/multifd: Cleanup src flushes on condition check, Fabiano Rosas, 2025/01/10
- [PULL 08/25] migration/multifd: Document the reason to sync for save_setup(), Fabiano Rosas, 2025/01/10
- [PULL 09/25] migration/multifd: Fix compat with QEMU < 9.0,
Fabiano Rosas <=
- [PULL 10/25] migration: Add helper to get target runstate, Fabiano Rosas, 2025/01/10
- [PULL 11/25] qmp/cont: Only activate disks if migration completed, Fabiano Rosas, 2025/01/10
- [PULL 12/25] migration/block: Make late-block-active the default, Fabiano Rosas, 2025/01/10
- [PULL 13/25] migration/block: Apply late-block-active behavior to postcopy, Fabiano Rosas, 2025/01/10
- [PULL 14/25] migration/block: Fix possible race with block_inactive, Fabiano Rosas, 2025/01/10
- [PULL 15/25] migration/block: Rewrite disk activation, Fabiano Rosas, 2025/01/10
- [PULL 16/25] migration: Add more error handling to analyze-migration.py, Fabiano Rosas, 2025/01/10
- [PULL 17/25] migration: Remove unused argument in vmsd_desc_field_end, Fabiano Rosas, 2025/01/10
- [PULL 18/25] migration: Fix parsing of s390 stream, Fabiano Rosas, 2025/01/10
- [PULL 19/25] migration: Rename vmstate_info_nullptr, Fabiano Rosas, 2025/01/10