From: Ashijeet Acharya <ashijeetacharya@gmail.com>
To: kwolf@redhat.com
Cc: rjones@redhat.com, jcody@redhat.com, mreitz@redhat.com,
eblake@redhat.com, berrange@redhat.com, pbonzini@redhat.com,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
Ashijeet Acharya <ashijeetacharya@gmail.com>
Subject: [Qemu-devel] [PATCH v4 4/5] block/ssh: Use InetSocketAddress options
Date: Tue, 25 Oct 2016 18:34:00 +0530 [thread overview]
Message-ID: <1477400641-7750-5-git-send-email-ashijeetacharya@gmail.com> (raw)
In-Reply-To: <1477400641-7750-1-git-send-email-ashijeetacharya@gmail.com>
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>
---
block/ssh.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/block/ssh.c b/block/ssh.c
index d814006..6e6966d 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -197,6 +197,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);
@@ -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, "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));
+ g_free(port_str);
qdict_put(options, "path", qstring_from_str(uri->path));
--
2.6.2
next prev parent reply other threads:[~2016-10-25 13:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-25 13:03 [Qemu-devel] [PATCH v4 0/5] Allow blockdev-add for SSH Ashijeet Acharya
2016-10-25 13:03 ` [Qemu-devel] [PATCH v4 1/5] block/ssh: Add ssh_has_filename_options_conflict() Ashijeet Acharya
2016-10-25 13:03 ` [Qemu-devel] [PATCH v4 2/5] util/qemu-sockets: Make inet_connect_saddr() public Ashijeet Acharya
2016-10-25 13:03 ` [Qemu-devel] [PATCH v4 3/5] block/ssh: Add InetSocketAddress and accept it Ashijeet Acharya
2016-10-25 13:04 ` Ashijeet Acharya [this message]
2016-10-25 13:04 ` [Qemu-devel] [PATCH v4 5/5] qapi: allow blockdev-add for ssh Ashijeet Acharya
2016-10-25 19:58 ` Eric Blake
2016-10-26 8:31 ` Kevin Wolf
2016-10-26 13:27 ` Eric Blake
2016-10-27 19:54 ` [Qemu-devel] [PATCH v4 0/5] Allow blockdev-add for SSH Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1477400641-7750-5-git-send-email-ashijeetacharya@gmail.com \
--to=ashijeetacharya@gmail.com \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).