From patchwork Sat Oct 15 09:04:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9377747 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 4681A60779 for ; Sat, 15 Oct 2016 09:14:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 364AE293F7 for ; Sat, 15 Oct 2016 09:14:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AE2F293F9; Sat, 15 Oct 2016 09:14:07 +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 C810B293F7 for ; Sat, 15 Oct 2016 09:14:06 +0000 (UTC) Received: from localhost ([::1]:51046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvL2c-0001Py-05 for patchwork-qemu-devel@patchwork.kernel.org; Sat, 15 Oct 2016 05:14:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvKwB-0005Cr-Dn for qemu-devel@nongnu.org; Sat, 15 Oct 2016 05:07:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvKw9-0001sW-Dd for qemu-devel@nongnu.org; Sat, 15 Oct 2016 05:07:26 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:36527) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bvKw9-0001sF-6e; Sat, 15 Oct 2016 05:07:25 -0400 Received: by mail-pf0-x241.google.com with SMTP id r16so8846963pfg.3; Sat, 15 Oct 2016 02:07:25 -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=ca5QqNcZxq7oN7xK0yLZJFGTelRa+ld8i8ZAne77WlU=; b=v2SCmPOEXy0td8BC663MEcqhw4oRbz2+bC1mdCMzo2MSGpdkIAu/uAGaxN6LOcdogs 7BxctVqJMtnmMlPSP5TxdgRTzS0CVUoBxYk7SftpjIE1ZX1ukq6vt1s9+rF+A9rqoln9 B4KcwPN6g88AozRseYW6c9fTm4qZ1vF8Cu2npSzU752GkuZMWeiA3DfpBsimcuODV4Df d9i1SKtICzDPVCVnHVLdIBwiOnRbE7U5AMAtavhjpTPfuPV3cmrwFTG/G0gjswhbNc5m GbmauEy2sGupbBSTiMLIN+VlYnNxV4rFYd6lw7xKWKN0FKmpjwqnndcXc66OROahBsUf x+bQ== 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=ca5QqNcZxq7oN7xK0yLZJFGTelRa+ld8i8ZAne77WlU=; b=VXDcN405/NBL3lzWL20vN+gb06et0lv9REbVgndFY5CTlR4fA3pibaUTzhF8svS3it ZjIN0jhM6MhH1nsOH9NBK2gerqcobwpGJmigp62biMHSpcoPO06I72DAksryOskhIelR GZOtXSE9UAcERzAr3bnu2is3RsgSvMJWdpKRRsjh2Nzl7YB7qUyLS4CPvRSdmXzHTe/U S2xk/IDaq7xyZ7btJHKZD02vshoCRqUTEsHjKDeHx6vFeltxv/BF6ai2xNUDrweAZCLB Vsm87mrw+u6m63/yr6dIo2/2lCeZW/P88pvTUKBQFYIslIDTfukpjPxDrJ3unYS59hWz TUUQ== X-Gm-Message-State: AA6/9RnLEsltUY9mYJ7CB5yQg0/PyLgIX0fESknhFUaMpN5L79k35R9DcAYMPlniTd+oyA== X-Received: by 10.98.87.79 with SMTP id l76mr24103024pfb.174.1476522444078; Sat, 15 Oct 2016 02:07:24 -0700 (PDT) Received: from linux.local ([27.251.197.196]) by smtp.gmail.com with ESMTPSA id a7sm5295159pan.34.2016.10.15.02.07.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Oct 2016 02:07:23 -0700 (PDT) From: Ashijeet Acharya To: kwolf@redhat.com Date: Sat, 15 Oct 2016 14:34:39 +0530 Message-Id: <1476522280-23211-5-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1476522280-23211-1-git-send-email-ashijeetacharya@gmail.com> References: <1476522280-23211-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] [v2 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, armbru@redhat.com, rjones@redhat.com, kraxel@redhat.com, Ashijeet Acharya , pbonzini@redhat.com, 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 Reviewed-by: Max Reitz --- block/ssh.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block/ssh.c b/block/ssh.c index 6420359..7fec0e1 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,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)); @@ -251,6 +251,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: