From patchwork Mon Oct 17 17:32:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9380067 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 DFF5A600CA for ; Mon, 17 Oct 2016 17:36:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7DF028D30 for ; Mon, 17 Oct 2016 17:36:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCCE528ECB; Mon, 17 Oct 2016 17:36:05 +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 823D428D68 for ; Mon, 17 Oct 2016 17:36:05 +0000 (UTC) Received: from localhost ([::1]:34676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwBpU-0005pB-N4 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 17 Oct 2016 13:36:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwBou-0005n7-Ix for qemu-devel@nongnu.org; Mon, 17 Oct 2016 13:35:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwBot-0006d3-OO for qemu-devel@nongnu.org; Mon, 17 Oct 2016 13:35:28 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:35517) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwBot-0006ct-Ip; Mon, 17 Oct 2016 13:35:27 -0400 Received: by mail-pf0-x241.google.com with SMTP id s8so13155593pfj.2; Mon, 17 Oct 2016 10:35:27 -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=BYJ+QCW/zaFMYx82KzZ3eoQC/+6Ox8urFR9zzkYX5nc=; b=k934sorrUmtvxPHP9WJoTuhLKOEJw+8gVrHsqklZ4z4KfP6WuStlPXjEY1iGxwtNkW tP0liYHsqt3u6VVXmBDiBIlMqgZaOOgNItoAZb03K1UZ+Zqkz519WKVqq/80AYpg44hO gcAtWeM39hlxUpRmTcBowGp9wgDaCjZo+kzrBghywv66iZBRro5Oc7uFILGS8vAEHDcW OS3d8fm6FpOyAwe+BDOn0UjtJzLqBgTZXa4ZS6+v5zccPV+ngs68aLupbctUsUxGTr2n nlmUgGvpJIINT0tLvweSsuiGNYLTaxg5PSSO3qpDNDvNzd3ZhkRJ9H3HECQqpg9NWB6d MTcQ== 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=BYJ+QCW/zaFMYx82KzZ3eoQC/+6Ox8urFR9zzkYX5nc=; b=ltkrp3lMzqVSrp3qieYucSwcz4QQJxQ5Fekey9Pl9lfqSQoU7vBcldlXpuvsvZFDZN liNOOC9e6KR1rmPBhRYmzYuRhHKUXkDqxZNInN1NDXVwsPSrPAP2TIyaJpPWCWQ5Cn74 DPFfnHQkPTyR5BbXQJaFqtPa8B6HmHIS7tepVmghIY5RnvaBY1UM5jUonAiQbHBrQHKL 6iO/kitMjJTdIZMS40hy3rzaXOTtPWFCthFJ7XBs9epI5cSkvJb9qFy0nipYVF0k3/tQ J9jsL5s+70UAwQrgHCmzwFAJmLmOVZvahA3VsEN7YjBobc776RYMq1ZFNUck6/ORvUxR GqIg== X-Gm-Message-State: AA6/9RnYuW+KZJx7UcjXKWvmviLrqqWpACxXqkA8MJz7PpEtFPNFKMqgpec86gzvWQKjXg== X-Received: by 10.98.23.144 with SMTP id 138mr39339846pfx.21.1476725726660; Mon, 17 Oct 2016 10:35:26 -0700 (PDT) Received: from linux.local ([27.251.197.196]) by smtp.gmail.com with ESMTPSA id 188sm49641264pfz.2.2016.10.17.10.35.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 10:35:26 -0700 (PDT) From: Ashijeet Acharya To: kwolf@redhat.com Date: Mon, 17 Oct 2016 23:02:12 +0530 Message-Id: <1476725535-3350-3-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 2/5] util/qemu-sockets: Make inet_connect_saddr() public 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 Make inet_connect_saddr() in util/qemu-sockets.c public in order to be able to use it with InetSocketAddress sockets outside of util/qemu-sockets.c independently. Signed-off-by: Ashijeet Acharya Reviewed-by: Kevin Wolf --- include/qemu/sockets.h | 2 ++ util/qemu-sockets.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index 9eb2470..5589e68 100644 --- a/include/qemu/sockets.h +++ b/include/qemu/sockets.h @@ -34,6 +34,8 @@ typedef void NonBlockingConnectHandler(int fd, Error *err, void *opaque); InetSocketAddress *inet_parse(const char *str, Error **errp); int inet_connect(const char *str, Error **errp); +int inet_connect_saddr(InetSocketAddress *saddr, Error **errp, + NonBlockingConnectHandler *callback, void *opaque); NetworkAddressFamily inet_netfamily(int family); diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 4cef549..31f7fc6 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -412,8 +412,8 @@ static struct addrinfo *inet_parse_connect_saddr(InetSocketAddress *saddr, * function succeeds, callback will be called when the connection * completes, with the file descriptor on success, or -1 on error. */ -static int inet_connect_saddr(InetSocketAddress *saddr, Error **errp, - NonBlockingConnectHandler *callback, void *opaque) +int inet_connect_saddr(InetSocketAddress *saddr, Error **errp, + NonBlockingConnectHandler *callback, void *opaque) { Error *local_err = NULL; struct addrinfo *res, *e;