From patchwork Mon Oct 17 17:32:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9380073 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 66C6C60487 for ; Mon, 17 Oct 2016 17:42:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 600B029084 for ; Mon, 17 Oct 2016 17:42:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EC072919A; Mon, 17 Oct 2016 17:42:58 +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.3 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 0000129084 for ; Mon, 17 Oct 2016 17:42:57 +0000 (UTC) Received: from localhost ([::1]:34720 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwBw5-0003RE-Ih for patchwork-qemu-devel@patchwork.kernel.org; Mon, 17 Oct 2016 13:42:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwBp5-0005wP-9F for qemu-devel@nongnu.org; Mon, 17 Oct 2016 13:35:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwBp3-0006f8-9D for qemu-devel@nongnu.org; Mon, 17 Oct 2016 13:35:39 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:34502) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwBp3-0006ez-01; Mon, 17 Oct 2016 13:35:37 -0400 Received: by mail-pf0-x241.google.com with SMTP id 128so13185018pfz.1; Mon, 17 Oct 2016 10:35:36 -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=lkotHi4n3Nm27GQ0xt6VVU/iPO7xl8MMRyU0tX1TSD0=; b=dfGQ02jfHUvziWBdtx2mJ9WatRZNXGSXPqBPdJV6i1eseEt3n1ZXW3ek4FDsijyRQ4 vxx6Fy5arBAbsraWY4jH1+2MvsLS4uKFa4leK/KscOT69BUZL1+Mp7eI+9/AJGVOEck6 cB1x+wTlcWRZl9Vo/ViQXgYYh4dYC5jhcGkFMe6cRemOGsKs6hftAV75kUsTHD6631qf seN32AtKc79NhJF4pXy9rWUvG+bbv4LQs0b4PvJPkfXRCLNBFBzLO8Ghq0Qh51yc138I c+tRQ/GxiOcY680jWdaltDTw05NJpAGmVn7uBkUIib+pl62pFngCB+dDF+SpfscKwF00 2IDQ== 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=lkotHi4n3Nm27GQ0xt6VVU/iPO7xl8MMRyU0tX1TSD0=; b=QlBTXt8ZAZnVraJDDQ58U+rT9D5nUhtEbBebN+OKRbL8HTr/mzfEtjASLvAroIYSwJ UyV5WUewhafGy9Zn+Zjd9FcptmHqqlJnR8J3nRGh3xs/bwFYU/7at1OtZDVnX2Dpwfc4 sLiKOVgSgCAKVd2enPFsANtOT0Pj5J2nBNHv74ehaqA4bj7ahseKm8zDxTpK+QOx4/tS WfU8Kbvd/cNfo5dC5SevZAImP0kw6XfdkvPr8qs/6FnVbgSyNRJX61vgqt/PG35EfK6n g0QcPYE9YqjCXpvFesvcXmhRr6rmdWT+5i38mtO3aQW+S6RjEhpb2QBIfg/6swPtsKLx 5cfA== X-Gm-Message-State: AA6/9RkKG6DnnO/qjj+h4pXKQNQQJcAgY7PPnhURS7cUBV8mODvsqL0BM6hHQxk8ARqZJQ== X-Received: by 10.99.55.21 with SMTP id e21mr32163464pga.60.1476725736145; Mon, 17 Oct 2016 10:35:36 -0700 (PDT) Received: from linux.local ([27.251.197.196]) by smtp.gmail.com with ESMTPSA id 188sm49641264pfz.2.2016.10.17.10.35.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 10:35:35 -0700 (PDT) From: Ashijeet Acharya To: kwolf@redhat.com Date: Mon, 17 Oct 2016 23:02:14 +0530 Message-Id: <1476725535-3350-5-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1476725535-3350-1-git-send-email-ashijeetacharya@gmail.com> References: <1476725535-3350-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:c00::241 Subject: [Qemu-devel] [PATCH v3 4/5] 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, qemu-devel@nongnu.org, jcody@redhat.com, rjones@redhat.com, mreitz@redhat.com, Ashijeet Acharya , pbonzini@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 Reviewed-by: Max Reitz Reviewed-by: Kevin Wolf --- block/ssh.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block/ssh.c b/block/ssh.c index 7963b48..9b693f6 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -199,6 +199,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); @@ -231,11 +232,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));