On Thu, Jul 13, 2023 at 10:57:07AM +0000, Het Gala wrote: > Socket transport backend for 'migrate'/'migrate-incoming' QAPIs accept > new wire protocol of MigrateAddress struct. > > It is achived by parsing 'uri' string and storing migration parameters > required for socket connection into well defined SocketAddress struct. > > Suggested-by: Aravind Retnakaran <[email protected]> > Signed-off-by: Het Gala <[email protected]> > --- > migration/migration.c | 32 +++++++++++++++++++------------- > migration/socket.c | 34 +++++----------------------------- > migration/socket.h | 7 ++++--- > 3 files changed, 28 insertions(+), 45 deletions(-) > > diff --git a/migration/migration.c b/migration/migration.c > index af2ec50061..8108d4248f 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -480,18 +480,21 @@ static void qemu_start_incoming_migration(const char > *uri, Error **errp) > } > > qapi_event_send_migration(MIGRATION_STATUS_SETUP); > - if (strstart(uri, "tcp:", &p) || > - strstart(uri, "unix:", NULL) || > - strstart(uri, "vsock:", NULL)) { > - socket_start_incoming_migration(p ? p : uri, errp); > + if (channel->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { > + SocketAddress *saddr = &channel->u.socket; > + if (saddr->type == SOCKET_ADDRESS_TYPE_INET || > + saddr->type == SOCKET_ADDRESS_TYPE_UNIX || > + saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) { > + socket_start_incoming_migration(saddr, errp); > + } else if (saddr->type == SOCKET_ADDRESS_TYPE_FD) { > + fd_start_incoming_migration(saddr->u.fd.str, errp); > + } > #ifdef CONFIG_RDMA > } else if (strstart(uri, "rdma:", &p)) { > rdma_start_incoming_migration(p, errp); > #endif > } else if (strstart(uri, "exec:", &p)) { > exec_start_incoming_migration(p, errp); > - } else if (strstart(uri, "fd:", &p)) { > - fd_start_incoming_migration(p, errp); > } else { > error_setg(errp, "unknown migration protocol: %s", uri); > } > @@ -1697,7 +1700,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool > blk, > return; > } > > - if (!migrate_uri_parse(uri, &channel, &local_err)) { > + if (!migrate_uri_parse(uri, &channel, errp)) { > return; > } >
This chunk should be squashed into the previous patch With that changed: Reviewed-by: Daniel P. Berrangé <[email protected]> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
