All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ashijeet Acharya <ashijeetacharya@gmail.com>
To: kwolf@redhat.com
Cc: rjones@redhat.com, jcody@redhat.com, eblake@redhat.com,
	mreitz@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org,
	qemu-block@nongnu.org,
	Ashijeet Acharya <ashijeetacharya@gmail.com>
Subject: [Qemu-devel] [PATCH 3/4] block/ssh: Use InetSocketAddress options
Date: Tue, 11 Oct 2016 13:07:16 +0530	[thread overview]
Message-ID: <1476171437-11830-4-git-send-email-ashijeetacharya@gmail.com> (raw)
In-Reply-To: <1476171437-11830-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>
---
 block/ssh.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/block/ssh.c b/block/ssh.c
index 702871a..399ed60 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -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:
-- 
2.6.2

  parent reply	other threads:[~2016-10-11  7:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-11  7:37 [Qemu-devel] [PATCH 0/4] Allow blockdev-add for SSH Ashijeet Acharya
2016-10-11  7:37 ` [Qemu-devel] [PATCH 1/4] block/ssh: Add ssh_has_filename_options_conflict() Ashijeet Acharya
2016-10-11  7:37 ` [Qemu-devel] [PATCH 2/4] block/ssh: Add InetSocketAddress and accept it Ashijeet Acharya
2016-10-12 15:51   ` Kevin Wolf
2016-10-12 16:49     ` Ashijeet Acharya
2016-10-13 18:34   ` Ashijeet Acharya
2016-10-11  7:37 ` Ashijeet Acharya [this message]
2016-10-11  7:37 ` [Qemu-devel] [PATCH 4/4] qapi: allow blockdev-add for ssh Ashijeet Acharya
2016-10-11 20:28 ` [Qemu-devel] [PATCH 0/4] Allow blockdev-add for SSH no-reply
2016-10-12  8:09 ` Ashijeet Acharya
2016-10-12  8:22   ` Kevin Wolf
2016-10-12  8:37     ` Ashijeet Acharya
2016-10-12  8:43       ` Kevin Wolf
2016-10-12  8:43   ` Ashijeet Acharya
2016-10-12 16:01 ` Kevin Wolf
2016-10-12 16:20   ` Ashijeet Acharya
2016-10-12 16:40     ` Kevin Wolf
2016-10-12 16:57       ` Ashijeet Acharya

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=1476171437-11830-4-git-send-email-ashijeetacharya@gmail.com \
    --to=ashijeetacharya@gmail.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.