From patchwork Tue Oct 25 13:04:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9394505 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 00A8960762 for ; Tue, 25 Oct 2016 13:07:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7A4B29593 for ; Tue, 25 Oct 2016 13:07:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA1602959D; Tue, 25 Oct 2016 13:07:55 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 8587A29593 for ; Tue, 25 Oct 2016 13:07:55 +0000 (UTC) Received: from localhost ([::1]:54358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz1SM-0008Ad-Nh for patchwork-qemu-devel@patchwork.kernel.org; Tue, 25 Oct 2016 09:07:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz1Rm-00089B-Cs for qemu-devel@nongnu.org; Tue, 25 Oct 2016 09:07:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bz1Ri-0001qD-0x for qemu-devel@nongnu.org; Tue, 25 Oct 2016 09:07:18 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:36468) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bz1Rh-0001pm-RO; Tue, 25 Oct 2016 09:07:13 -0400 Received: by mail-pf0-x242.google.com with SMTP id n85so483367pfi.3; Tue, 25 Oct 2016 06:07:13 -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=6xqh/i1hFyQ7kWp9maPrTmPd0jiEotUKbAFYLb/qk6M=; b=X/rAOK9q0blE08LO0YGJNQ0NgUJH3cTb44bimFju1SpcHnKLoz/DGpgzXUNwbHVeWH QGeQoma0czvJm5iUoLYST4chO2xoRQo3dsqGwrWuBcjvK22xzJ0zqQZyBB1m+AMoZ9ZH OyvNeBxd6hWG8phXd0YAmlsXfVhi9nW0h8+q78KEzrPbIKk+ekcRd0+98wUatcsWToK9 xACLdRDjKNq/sxUEhrb65P3KjXyzXBPBAFRCl8cTkgmmsfQw1SJtyLvmqMaU7mx8FItM xDBLIQKnO0Xj8vz+U2NBFuIMF9I/KUsY5czrvGuk2CRa7lutIFjAy8NUcnaaygrcEiNW Ic0Q== 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=6xqh/i1hFyQ7kWp9maPrTmPd0jiEotUKbAFYLb/qk6M=; b=OM0Q+jP8+jdw6syhwdwiwc6rJzP4/xwDcqn9FxNp8cjrCP8Ps8dGhq3VMEM9C1WwWe 5jZSEiQwZ75owi+zHI64xAu/8bqYQCh4YyyCF/BS40AvQn5I2hhXrpnSh9DndayfzdN9 CBasXBtzBTmCq45gqWp2/fsfZ8qLpFXRELIz2wyUDLfYPOaB7Nvhba9hpT8J74d9Sohk j3XKIyqkZhnj85zDMAFdrKhup5pvgoBtxc5xmweQey2X914TUZ6Uo/zL3pRlMLHAgk+q +e3Hdg1oikOcS5yK41hqytWgzDTzG317EjUmIXScgRlsoa603HOE4vwMATqAYX8oFwEj MsQQ== X-Gm-Message-State: ABUngvf5jboz8rlPFP2KdbXkphnoPoD8p9xAL0DNBLUU0IQPxKkc+hDXU/rWfiI2ONOFGg== X-Received: by 10.98.7.83 with SMTP id b80mr39276190pfd.181.1477400832867; Tue, 25 Oct 2016 06:07:12 -0700 (PDT) Received: from linux.local ([106.208.9.126]) by smtp.gmail.com with ESMTPSA id u17sm33461160pfi.1.2016.10.25.06.07.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Oct 2016 06:07:12 -0700 (PDT) From: Ashijeet Acharya To: kwolf@redhat.com Date: Tue, 25 Oct 2016 18:34:00 +0530 Message-Id: <1477400641-7750-5-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1477400641-7750-1-git-send-email-ashijeetacharya@gmail.com> References: <1477400641-7750-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::242 Subject: [Qemu-devel] [PATCH v4 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 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));