[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.2.1 17/41] migration/multifd: Fix compat with QEMU < 9.0
From: |
Michael Tokarev |
Subject: |
[Stable-9.2.1 17/41] migration/multifd: Fix compat with QEMU < 9.0 |
Date: |
Mon, 27 Jan 2025 17:17:31 +0300 |
From: Fabiano Rosas <farosas@suse.de>
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>
(cherry picked from commit b93d897ea2f0abbe7fc341a9ac176b5ecd0f3c93)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/migration/multifd.c b/migration/multifd.c
index 498e71fd10..8d0a763a72 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);
@@ -1151,9 +1150,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.39.5
- [Stable-9.2.1 04/41] x86/loader: only patch linux kernels, (continued)
- [Stable-9.2.1 04/41] x86/loader: only patch linux kernels, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 30/41] tests/qtest/boot-serial-test: Correct HPPA machine name, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 32/41] hw/usb/hcd-xhci-pci: Use modulo to select MSI vector as per spec, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 33/41] pci: ensure valid link status bits for downstream ports, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 14/41] docs: Correct release of TCG trace-events removal, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 10/41] hw/intc/riscv_aplic: Fix APLIC in_clrip and clripnum write emulation, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 07/41] hw/intc/arm_gicv3_its: Zero initialize local DTEntry etc structs, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 13/41] docs: Correct '-runas' and '-fsdev/-virtfs proxy' indentation, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 15/41] target/i386/cpu: Fix notes for CPU models, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 12/41] target/loongarch: Use actual operand size with vbsrl check, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 17/41] migration/multifd: Fix compat with QEMU < 9.0,
Michael Tokarev <=
- [Stable-9.2.1 22/41] migration: Rename vmstate_info_nullptr, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 16/41] migration/multifd: Fix compile error caused by page_size usage, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 20/41] migration: Fix parsing of s390 stream, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 19/41] migration: Remove unused argument in vmsd_desc_field_end, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 18/41] migration: Add more error handling to analyze-migration.py, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 21/41] s390x: Fix CSS migration, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 24/41] migration: Fix arrays of pointers in JSON writer, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 02/41] tcg: Reset free_temps before tcg_optimize, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 23/41] migration: Dump correct JSON format for nullptr replacement, Michael Tokarev, 2025/01/27
- [Stable-9.2.1 25/41] multifd: bugfix for migration using compression methods, Michael Tokarev, 2025/01/27