From patchwork Tue Oct 11 07:37:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9370203 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2493E6048F for ; Tue, 11 Oct 2016 07:41:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC01D28730 for ; Tue, 11 Oct 2016 07:41:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0CD229AC5; Tue, 11 Oct 2016 07:41:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 874B328730 for ; Tue, 11 Oct 2016 07:41:25 +0000 (UTC) Received: from localhost ([::1]:54183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btrgi-0004UK-QN for patchwork-qemu-devel@patchwork.kernel.org; Tue, 11 Oct 2016 03:41:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btrg7-0004PU-Qw for qemu-devel@nongnu.org; Tue, 11 Oct 2016 03:40:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btrg6-0006fS-Rq for qemu-devel@nongnu.org; Tue, 11 Oct 2016 03:40:47 -0400 Received: from mail-pa0-x243.google.com ([2607:f8b0:400e:c03::243]:36713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btrg6-0006fH-Kk; Tue, 11 Oct 2016 03:40:46 -0400 Received: by mail-pa0-x243.google.com with SMTP id rw4so1105085pab.3; Tue, 11 Oct 2016 00:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ua5xUvGVEex32m8v5QLPyvNsIwBrTRIr4nqTpafJU4I=; b=oTb5ImZdmB/qAVz4JSgwMLG/FU5M0Upqv4Xq5LRjKpyHowAkxLeCrXdYtl1uEncYCk cWTPYcB/02vdt7q6nV1XNy5fJVpaSTjyXGvwzzmDkYF023QbOS+Xw5dPuS022pkggl+D B6X87nd/xmGT19MejNype9uM28R7IvgGAfRzIOfMFpgOTQYEgT1LXq5Fvrnwnun8CQ7g hXrlR/y9S+pLJYqT+k9NSJHPZbPh79Gj2g6eG0/+nU6VdA2vqMJyub2J0SY+LQ2Mge2t AGbPAvv4qLtP5p3IwSFwJ8Sez9HIKbUztMckhdVdaLkkg0XK2RCGuCsOVzVqs0ByEe/s g3+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ua5xUvGVEex32m8v5QLPyvNsIwBrTRIr4nqTpafJU4I=; b=i7SZzkRUpPolD9/CUFXdeHvr9/3utKr6ptUDYqzTwv8oN2YNo9bKcBPMjceY3w9tfw INadQwbC7IExTiOigIMFBEsJGIXUT3RvghpXIpd27o+oH3YmNQ808CghTK/cJPe+RUxd RiLdTTlxZUEmWtabRv3sNey6/DCgVqLCugriB0OWv7PVDPh3ydI9Eda2PiqmTXZEd6RT PpNYzTlT3NPz5RxSQAvC0DMpWC/LufdB8V6h7hUZcgMhGH0XnL7+SvnGfXHWta6XNe/h G+25Y2B75TGK/8qBIpyYKkJoiOC5Cgjgi1VRgH5qJZ9sXPat8o+WS/0HKm1lxXP9xdCy 6c4g== X-Gm-Message-State: AA6/9RmpGVhcVWNwj5Zs+Xs8P7MNqV+BksyrFJcA9PNHlvN0tMsWC8cRjmOcK11rKzzWZg== X-Received: by 10.66.219.201 with SMTP id pq9mr4725497pac.32.1476171645918; Tue, 11 Oct 2016 00:40:45 -0700 (PDT) Received: from linux.local ([27.251.197.196]) by smtp.gmail.com with ESMTPSA id v86sm2475563pfa.91.2016.10.11.00.40.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Oct 2016 00:40:45 -0700 (PDT) From: Ashijeet Acharya To: kwolf@redhat.com Date: Tue, 11 Oct 2016 13:07:16 +0530 Message-Id: <1476171437-11830-4-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1476171437-11830-1-git-send-email-ashijeetacharya@gmail.com> References: <1476171437-11830-1-git-send-email-ashijeetacharya@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::243 Subject: [Qemu-devel] [PATCH 3/4] block/ssh: Use InetSocketAddress options X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-block@nongnu.org, rjones@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, Ashijeet Acharya , mreitz@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Drop the use of legacy options in favour of the InetSocketAddress options. Signed-off-by: Ashijeet Acharya --- 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: