MigrateChannelList ideally allows to connect accross multiple interfaces.
Added MigrateChannelList struct as argument to 'migrate' qapi. Introduced
MigrateChannelList in hmp_migrate() and qmp_migrate() functions.
Future patchset series plans to include multiple MigrateChannels
for multiple interfaces to be connected. That is the reason,
'MigrateChannelList'
is the preferred choice of argument over 'MigrateChannel' and making 'migrate'
QAPI future proof.
For current patch, have just limit size of MigrateChannelList to 1 element as
a runtime check.
Suggested-by: Aravind Retnakaran <aravind.retnakaran@nutanix.com>
Signed-off-by: Het Gala <het.gala@nutanix.com>
---
migration/migration-hmp-cmds.c | 113 ++++++++++++++++++++++++++++++++-
migration/migration.c | 17 ++++-
qapi/migration.json | 69 +++++++++++++++++++-
3 files changed, 192 insertions(+), 7 deletions(-)
diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c
index 4e9f00e7dc..f098d04542 100644
--- a/migration/migration-hmp-cmds.c
+++ b/migration/migration-hmp-cmds.c
@@ -51,6 +51,101 @@ static void migration_global_dump(Monitor *mon)
ms->clear_bitmap_shift);
}
+static bool
+migrate_channel_from_qdict(MigrateChannel **channel,
+ const QDict *qdict, Error **errp)
+{
+ Error *err = NULL;
+ const char *channeltype = qdict_get_try_str(qdict, "channeltype");
+ const char *transport_str = qdict_get_try_str(qdict, "transport");
+ const char *socketaddr_type = qdict_get_try_str(qdict, "type");
+ const char *inet_host = qdict_get_try_str(qdict, "host");
+ const char *inet_port = qdict_get_try_str(qdict, "port");
+ const char *unix_path = qdict_get_try_str(qdict, "path");
+ const char *vsock_cid = qdict_get_try_str(qdict, "cid");
+ const char *vsock_port = qdict_get_try_str(qdict, "port");
+ const char *fd = qdict_get_try_str(qdict, "str");
+ QList *exec = qdict_get_qlist(qdict, "exec");