[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
check magic value for deciding the mapping of channels
From: |
manish.mishra |
Subject: |
check magic value for deciding the mapping of channels |
Date: |
Sat, 19 Nov 2022 09:36:13 +0000 |
Current logic assumes that channel connections on the destination side are
always established in the same order as the source and the first one will
always be the main channel followed by the multifid or post-copy
preemption channel. This may not be always true, as even if a channel has a
connection established on the source side it can be in the pending state on
the destination side and a newer connection can be established first.
Basically causing out of order mapping of channels on the destination side.
Currently, all channels except post-copy preempt send a magic number, this
patch uses that magic number to decide the type of channel. This logic is
applicable only for precopy(multifd) live migration, as mentioned, the
post-copy preempt channel does not send any magic number. Also, tls live
migrations already does tls handshake before creating other channels, so
this issue is not possible with tls, hence this logic is avoided for tls
live migrations. This patch uses MSG_PEEK to check the magic number of
channels so that current data/control stream management remains
un-effected.
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: manish.mishra <manish.mishra@nutanix.com>
v2:
TLS does not support MSG_PEEK, so V1 was broken for tls live
migrations. For tls live migration, while initializing main channel
tls handshake is done before we can create other channels, so this
issue is not possible for tls live migrations. In V2 added a check
to avoid checking magic number for tls live migration and fallback
to older method to decide mapping of channels on destination side.
v3:
1. Split change in two patches, io patch for read_peek routines,
migration patch for migration related changes.
2. Add flags to io_readv calls to get extra read flags like
MSG_PEEK.
3. Some other minor fixes.
manish.mishra (2):
io: Add support for MSG_PEEK for socket channel
migration: check magic value for deciding the mapping of channels
chardev/char-socket.c | 4 +-
include/io/channel.h | 83 +++++++++++++++++++++++++++++
io/channel-buffer.c | 1 +
io/channel-command.c | 1 +
io/channel-file.c | 1 +
io/channel-null.c | 1 +
io/channel-socket.c | 16 +++++-
io/channel-tls.c | 1 +
io/channel-websock.c | 1 +
io/channel.c | 73 +++++++++++++++++++++++--
migration/channel-block.c | 1 +
migration/migration.c | 44 ++++++++++-----
migration/multifd.c | 12 ++---
migration/multifd.h | 2 +-
migration/postcopy-ram.c | 5 +-
migration/postcopy-ram.h | 2 +-
scsi/qemu-pr-helper.c | 2 +-
tests/qtest/tpm-emu.c | 2 +-
tests/unit/test-io-channel-socket.c | 1 +
util/vhost-user-server.c | 2 +-
20 files changed, 218 insertions(+), 37 deletions(-)
--
2.22.3