From patchwork Tue Oct 25 13:03:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9394519 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 7FF476077F for ; Tue, 25 Oct 2016 13:15:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 672B6288AE for ; Tue, 25 Oct 2016 13:15:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5832E29516; Tue, 25 Oct 2016 13:15:52 +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 DE414288AE for ; Tue, 25 Oct 2016 13:15:51 +0000 (UTC) Received: from localhost ([::1]:54414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz1a3-0006cc-2d for patchwork-qemu-devel@patchwork.kernel.org; Tue, 25 Oct 2016 09:15:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz1RT-0007yE-Us for qemu-devel@nongnu.org; Tue, 25 Oct 2016 09:07:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bz1RT-0001lL-2y for qemu-devel@nongnu.org; Tue, 25 Oct 2016 09:06:59 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:36452) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bz1RS-0001lG-TI; Tue, 25 Oct 2016 09:06:59 -0400 Received: by mail-pf0-x243.google.com with SMTP id n85so482817pfi.3; Tue, 25 Oct 2016 06:06:58 -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=GsUeP6LcJ22vqaQX9eH6O2fjfxc2ss3PICZfDjLo7u4=; b=S1QHy7vj+JwM6BVxf3QMBuOK0NI8gDXm8+wpJyIXt+jlKFMSg7/gk4wws/UWvVXPWY ioqTWLSvkJWn7ZYgC8dIr9ZP6Jfjb9FsO/vmuuE0OE+ltUupltw0Y1xmsWzvnrlGH4Xl 2jVJaVWzmsM2dV52hzNHOCLKT9W6kW3FWLg6J53+PKnSDKtyXOzjFnmwAy669T8XhCYY N8PbdDUIlywikbwToAvUL4om5/noBmtCCKyHuQoYLM/qgV53Iq7xd6M5TPea1TdvA0ej o1WJ3/dxQvAwYw55Yra9qpAMt1IfHJioZbsjuinHDC70PW9W9kurZRWKG9x89h1vtOQJ XmZg== 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=GsUeP6LcJ22vqaQX9eH6O2fjfxc2ss3PICZfDjLo7u4=; b=itEbJh9LitXVSIB00JzoPhf/1oCm2ZbBJps6aWtt8IJ5b6Qkl9k+wqKQVKLoJvwc2C x60i1VtJUPT1JQ5lkkdI3tYd9wGFeWERlgIX4nEmYobBPSF9NYMqh42Z24ZhS2/5noTP q/A1AXNgs5fsIpMrbK+V3+Z7FqpnKrtX6Yi4yj1IKsE6mMnk7BtXIsH8KDKrGxUvt02N CDqpAM69jyznvjZpehvBX86n2nLZC+JSQ21vl45rHSThbuvM/jPIoWj4l4MzK8rW/xc8 VLaNCcAJcqSbd+8UwbRM4O/aQ1+1dxCznugFh+WzSIZEUlio//yzB0fTWegGjDAkI6P0 yJpw== X-Gm-Message-State: ABUngveZ5A92LNyhKZUH85WK0xNTDG4nay9qSvlr6f++SUQhjTS+6DMVMaYI5yFdO8Z6Vg== X-Received: by 10.98.106.196 with SMTP id f187mr38985676pfc.91.1477400818056; Tue, 25 Oct 2016 06:06:58 -0700 (PDT) Received: from linux.local ([106.208.9.126]) by smtp.gmail.com with ESMTPSA id u17sm33461160pfi.1.2016.10.25.06.06.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Oct 2016 06:06:57 -0700 (PDT) From: Ashijeet Acharya To: kwolf@redhat.com Date: Tue, 25 Oct 2016 18:33:58 +0530 Message-Id: <1477400641-7750-3-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::243 Subject: [Qemu-devel] [PATCH v4 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;