[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.2.2 20/60] migration: Fix logic of channels and transport comp
From: |
Michael Tokarev |
Subject: |
[Stable-8.2.2 20/60] migration: Fix logic of channels and transport compatibility check |
Date: |
Wed, 21 Feb 2024 11:20:08 +0300 |
From: Avihai Horon <avihaih@nvidia.com>
The commit in the fixes line mistakenly modified the channels and
transport compatibility check logic so it now checks multi-channel
support only for socket transport type.
Thus, running multifd migration using a transport other than socket that
is incompatible with multi-channels (such as "exec") would lead to a
segmentation fault instead of an error message.
For example:
(qemu) migrate_set_capability multifd on
(qemu) migrate -d "exec:cat > /tmp/vm_state"
Segmentation fault (core dumped)
Fix it by checking multi-channel compatibility for all transport types.
Cc: qemu-stable <qemu-stable@nongnu.org>
Fixes: d95533e1cdcc ("migration: modify migration_channels_and_uri_compatible()
for new QAPI syntax")
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/20240125162528.7552-2-avihaih@nvidia.com
Signed-off-by: Peter Xu <peterx@redhat.com>
(cherry picked from commit 3205bebd4fc6dd501fb8b10c93ddce9da18e09db)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/migration/migration.c b/migration/migration.c
index ee5e0ba97a..982ab85f04 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -128,11 +128,17 @@ static bool migration_needs_multiple_sockets(void)
return migrate_multifd() || migrate_postcopy_preempt();
}
-static bool transport_supports_multi_channels(SocketAddress *saddr)
+static bool transport_supports_multi_channels(MigrationAddress *addr)
{
- return saddr->type == SOCKET_ADDRESS_TYPE_INET ||
- saddr->type == SOCKET_ADDRESS_TYPE_UNIX ||
- saddr->type == SOCKET_ADDRESS_TYPE_VSOCK;
+ if (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) {
+ SocketAddress *saddr = &addr->u.socket;
+
+ return saddr->type == SOCKET_ADDRESS_TYPE_INET ||
+ saddr->type == SOCKET_ADDRESS_TYPE_UNIX ||
+ saddr->type == SOCKET_ADDRESS_TYPE_VSOCK;
+ }
+
+ return false;
}
static bool
@@ -140,8 +146,7 @@
migration_channels_and_transport_compatible(MigrationAddress *addr,
Error **errp)
{
if (migration_needs_multiple_sockets() &&
- (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) &&
- !transport_supports_multi_channels(&addr->u.socket)) {
+ !transport_supports_multi_channels(addr)) {
error_setg(errp, "Migration requires multi-channel URIs (e.g. tcp)");
return false;
}
--
2.39.2
- [Stable-8.2.2 14/60] hw/scsi/lsi53c895a: add missing decrement of reentrancy counter, (continued)
- [Stable-8.2.2 14/60] hw/scsi/lsi53c895a: add missing decrement of reentrancy counter, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 10/60] target/arm: Reinstate "vfp" property on AArch32 CPUs, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 16/60] iotests: give tempdir an identifying name, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 34/60] virtio-gpu: Correct virgl_renderer_resource_get_info() error check, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 38/60] hw/i386: Fix _STA return value for ACPI0017, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 39/60] tests/acpi: Update DSDT.cxl to reflect change _STA return value., Michael Tokarev, 2024/02/21
- [Stable-8.2.2 40/60] linux-user/aarch64: Choose SYNC as the preferred MTE mode, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 21/60] hw/riscv/virt-acpi-build.c: fix leak in build_rhct(), Michael Tokarev, 2024/02/21
- [Stable-8.2.2 28/60] tcg/arm: Fix goto_tb for large translation blocks, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 27/60] tcg: Increase width of temp_subindex, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 20/60] migration: Fix logic of channels and transport compatibility check,
Michael Tokarev <=
- [Stable-8.2.2 23/60] configure: run plugin TCG tests again, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 29/60] vhost-user.rst: Fix vring address description, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 47/60] iotests: Make 144 deterministic again, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 51/60] i386/cpuid: Decrease cpuid_i when skipping CPUID leaf 1F, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 48/60] .gitlab-ci/windows.yml: Don't install libusb or spice packages on 32-bit, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 58/60] audio: Depend on dbus_display1_dep, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 56/60] ui/clipboard: add asserts for update and request, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 59/60] meson: Explicitly specify dbus-display1.h dependency, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 36/60] smmu: Clear SMMUPciBus pointer cache when system reset, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 45/60] target/arm: Fix SVE/SME gross MTE suppression checks, Michael Tokarev, 2024/02/21