@@ -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 {
@@ -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);
@@ -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);