mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
block/ssh: Use InetSocketAddress options
Drop the use of legacy options in favour of the InetSocketAddress options. Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
0da5b8ef5d
commit
1059f1bb42
1 changed files with 5 additions and 4 deletions
|
@ -197,6 +197,7 @@ static int parse_uri(const char *filename, QDict *options, Error **errp)
|
||||||
{
|
{
|
||||||
URI *uri = NULL;
|
URI *uri = NULL;
|
||||||
QueryParams *qp;
|
QueryParams *qp;
|
||||||
|
char *port_str;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
uri = uri_parse(filename);
|
uri = uri_parse(filename);
|
||||||
|
@ -229,11 +230,11 @@ static int parse_uri(const char *filename, QDict *options, Error **errp)
|
||||||
qdict_put(options, "user", qstring_from_str(uri->user));
|
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) {
|
port_str = g_strdup_printf("%d", uri->port ?: 22);
|
||||||
qdict_put(options, "port", qint_from_int(uri->port));
|
qdict_put(options, "server.port", qstring_from_str(port_str));
|
||||||
}
|
g_free(port_str);
|
||||||
|
|
||||||
qdict_put(options, "path", qstring_from_str(uri->path));
|
qdict_put(options, "path", qstring_from_str(uri->path));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue