Het Gala <het.g...@nutanix.com> wrote: > MigrateChannelList ideally allows to have multiple listener interfaces up for > connection. > > Added MigrateChannelList struct as argument to 'migrate-incoming' qapi. > Introduced > MigrateChannelList in hmp_migrate_incoming() and qmp_migrate_incoming() > functions. > > Future patchset series plans to include multiple MigrateChannels to have > multiple > listening interfaces up. That is the reason, 'MigrateChannelList' is the > preferred > choice of argument over 'MigrateChannel' and making 'migrate-incoming' QAPI > future > proof. > > For current patch, have just limit size of MigrateChannelList to 1 element as > a runtime check. > > Suggested-by: Aravind Retnakaran <aravind.retnaka...@nutanix.com> > Signed-off-by: Het Gala <het.g...@nutanix.com> > --- > migration/migration-hmp-cmds.c | 14 +++++++++++++- > migration/migration.c | 21 ++++++++++++++++---- > qapi/migration.json | 35 +++++++++++++++++++++++++++++++++- > softmmu/vl.c | 2 +- > 4 files changed, 65 insertions(+), 7 deletions(-) > > diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c > index f098d04542..8c11a8c83b 100644 > --- a/migration/migration-hmp-cmds.c > +++ b/migration/migration-hmp-cmds.c > @@ -518,10 +518,22 @@ void hmp_migrate_incoming(Monitor *mon, const QDict > *qdict) > { > Error *err = NULL; > const char *uri = qdict_get_str(qdict, "uri"); > + MigrateChannel *channel = g_new0(MigrateChannel, 1); > + MigrateChannelList *caps = NULL; > + > + if (!migrate_channel_from_qdict(&channel, qdict, &err)) { > + error_setg(&err, "error in retrieving channel from qdict"); > + goto end; > + } > > - qmp_migrate_incoming(uri, &err); > + QAPI_LIST_PREPEND(caps, channel); > + qmp_migrate_incoming(uri, !!caps, caps, &err); > + qapi_free_MigrateChannelList(caps); > > +end: > + qapi_free_MigrateChannel(channel); > hmp_handle_error(mon, err); > + return;
Useless return? The rest seeams ok.