@@ -31,6 +31,7 @@ int migration_channel_read_peek(QIOChannel *ioc,
Error **errp);
typedef enum {
MIG_CHANNEL_TYPE_MAIN,
+ MIG_CHANNEL_TYPE_POSTCOPY_PREEMPT,
} MigChannelTypes;
typedef struct QEMU_PACKED {
@@ -1019,6 +1019,11 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)
migration_incoming_setup(f);
default_channel = true;
break;
+ case MIG_CHANNEL_TYPE_POSTCOPY_PREEMPT:
+ assert(migrate_postcopy_preempt());
+ f = qemu_file_new_input(ioc);
+ postcopy_preempt_new_channel(migration_incoming_get_current(), f);
+ break;
default:
error_setg(errp, "Received unknown migration channel type %u",
header.channel_type);
@@ -1775,8 +1775,11 @@ int postcopy_preempt_establish_channel(MigrationState *s)
void postcopy_preempt_setup(MigrationState *s)
{
PostcopyPChannelConnectData *data;
+ MigChannelHeader header = {};
- data = pcopy_preempt_connect_data_new(s, NULL);
+ header.channel_type = MIG_CHANNEL_TYPE_POSTCOPY_PREEMPT;
+
+ data = pcopy_preempt_connect_data_new(s, &header);
/* Kick an async task to connect */
socket_send_channel_create(postcopy_preempt_send_channel_new,
data, pcopy_preempt_connect_data_unref);