@@ -198,6 +198,7 @@ static int parse_uri(const char *filename, QDict *options, Error **errp)
{
URI *uri = NULL;
QueryParams *qp;
+ char *port_str;
int i;
uri = uri_parse(filename);
@@ -230,11 +231,10 @@ static int parse_uri(const char *filename, QDict *options, Error **errp)
qdict_put(options, "user", qstring_from_str(uri->user));
}
- qdict_put(options, "host", qstring_from_str(uri->server));
+ qdict_put(options, "server.host", qstring_from_str(uri->server));
- if (uri->port) {
- qdict_put(options, "port", qint_from_int(uri->port));
- }
+ port_str = g_strdup_printf("%d", uri->port ?: 22);
+ qdict_put(options, "server.port", qstring_from_str(port_str));
qdict_put(options, "path", qstring_from_str(uri->path));
@@ -250,6 +250,7 @@ static int parse_uri(const char *filename, QDict *options, Error **errp)
query_params_free(qp);
uri_free(uri);
+ g_free(port_str);
return 0;
err:
Drop the use of legacy options in favour of the InetSocketAddress options. Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com> --- block/ssh.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)