[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC 10/26] migration: Add send/receive header for multifd channel
From: |
Maciej S. Szmigiero |
Subject: |
[PATCH RFC 10/26] migration: Add send/receive header for multifd channel |
Date: |
Tue, 16 Apr 2024 16:42:49 +0200 |
From: Avihai Horon <avihaih@nvidia.com>
Add send and receive migration channel header for multifd channel.
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
[MSS: Adapt to rewritten migration header passing commit]
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
---
migration/channel.h | 1 +
migration/migration.c | 16 ++++++++++++++++
migration/multifd.c | 4 +++-
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/migration/channel.h b/migration/channel.h
index c59ccedc7b6b..4232ee649939 100644
--- a/migration/channel.h
+++ b/migration/channel.h
@@ -32,6 +32,7 @@ int migration_channel_read_peek(QIOChannel *ioc,
typedef enum {
MIG_CHANNEL_TYPE_MAIN,
MIG_CHANNEL_TYPE_POSTCOPY_PREEMPT,
+ MIG_CHANNEL_TYPE_MULTIFD,
} MigChannelTypes;
typedef struct QEMU_PACKED {
diff --git a/migration/migration.c b/migration/migration.c
index ac9ecf1f4f22..8fe8be71a0e3 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1024,6 +1024,22 @@ void migration_ioc_process_incoming(QIOChannel *ioc,
Error **errp)
f = qemu_file_new_input(ioc);
postcopy_preempt_new_channel(migration_incoming_get_current(), f);
break;
+ case MIG_CHANNEL_TYPE_MULTIFD:
+ {
+ Error *local_err = NULL;
+
+ assert(migrate_multifd());
+ if (multifd_recv_setup(errp) != 0) {
+ return;
+ }
+
+ multifd_recv_new_channel(ioc, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
+ break;
+ }
default:
error_setg(errp, "Received unknown migration channel type %u",
header.channel_type);
diff --git a/migration/multifd.c b/migration/multifd.c
index 8eecda68ac0f..c2575e3d6dbf 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -1191,8 +1191,10 @@ out:
static bool multifd_new_send_channel_create(MultiFDSendParams *p, Error **errp)
{
g_autoptr(MFDSendChannelConnectData) data = NULL;
+ MigChannelHeader header = {};
- data = mfd_send_channel_connect_data_new(p, NULL);
+ header.channel_type = MIG_CHANNEL_TYPE_MULTIFD;
+ data = mfd_send_channel_connect_data_new(p, &header);
if (!multifd_use_packets()) {
return file_send_channel_create(data, errp);
- [PATCH RFC 00/26] Multifd 🔀 device state transfer support with VFIO consumer, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 03/26] migration: Add send/receive header for main channel, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 01/26] migration: Add x-channel-header pseudo-capability, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 02/26] migration: Add migration channel header send/receive, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 05/26] migration: Add a DestroyNotify parameter to socket_send_channel_create(), Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 04/26] multifd: change multifd_new_send_channel_create() param type, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 06/26] multifd: pass MFDSendChannelConnectData when connecting sending socket, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 07/26] migration/postcopy: pass PostcopyPChannelConnectData when connecting sending preempt socket, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 09/26] migration: Add send/receive header for postcopy preempt channel, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 08/26] migration: Allow passing migration header in migration channel creation, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 10/26] migration: Add send/receive header for multifd channel,
Maciej S. Szmigiero <=
- [PATCH RFC 11/26] migration/options: Mapped-ram is not channel header compatible, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 12/26] migration: Enable x-channel-header pseudo-capability, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 13/26] vfio/migration: Add save_{iterate, complete_precopy}_started trace events, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 14/26] migration/ram: Add load start trace event, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 15/26] migration/multifd: Zero p->flags before starting filling a packet, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 16/26] migration: Add save_live_complete_precopy_async{, wait} handlers, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 18/26] migration: Add load_finish handler and associated functions, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 17/26] migration: Add qemu_loadvm_load_state_buffer() and its handler, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 22/26] migration/multifd: Convert multifd_send_pages::next_channel to atomic, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 21/26] migration/multifd: Device state transfer support - receive side, Maciej S. Szmigiero, 2024/04/16