From patchwork Thu Dec 17 16:44:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Molton X-Patchwork-Id: 41330 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EFBD7B6F05 for ; Fri, 18 Dec 2009 03:49:24 +1100 (EST) Received: from localhost ([127.0.0.1]:38759 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLJXW-0008Sh-AT for incoming@patchwork.ozlabs.org; Thu, 17 Dec 2009 11:49:22 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLJV9-00071b-0c for qemu-devel@nongnu.org; Thu, 17 Dec 2009 11:46:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLJV7-000707-8U for qemu-devel@nongnu.org; Thu, 17 Dec 2009 11:46:54 -0500 Received: from [199.232.76.173] (port=44944 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLJV6-0006zl-UD for qemu-devel@nongnu.org; Thu, 17 Dec 2009 11:46:52 -0500 Received: from bhuna.collabora.co.uk ([93.93.128.226]:33984) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NLJV5-0000G8-4h for qemu-devel@nongnu.org; Thu, 17 Dec 2009 11:46:51 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ian) with ESMTPSA id B54626017E6 From: Ian Molton To: qemu-devel@nongnu.org Date: Thu, 17 Dec 2009 16:44:52 +0000 Message-Id: <1261068295-25831-2-git-send-email-ian.molton@collabora.co.uk> X-Mailer: git-send-email 1.6.5.4 In-Reply-To: <1261068295-25831-1-git-send-email-ian.molton@collabora.co.uk> References: <1261068295-25831-1-git-send-email-ian.molton@collabora.co.uk> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Ian Molton Subject: [Qemu-devel] [PATCH 1/4] socket: Rationalise function declarations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch rationalises the declaration of inet_listen_opts such that it matches the other inet_{listen,connect}_opts functions. This change is needed for a patch adding socket reconection support. Signed-off-by: Ian Molton --- qemu-sockets.c | 9 +++++++-- qemu_socket.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/qemu-sockets.c b/qemu-sockets.c index 8850516..ea338de 100644 --- a/qemu-sockets.c +++ b/qemu-sockets.c @@ -116,7 +116,7 @@ static void inet_print_addrinfo(const char *tag, struct addrinfo *res) } } -int inet_listen_opts(QemuOpts *opts, int port_offset) +static int do_inet_listen(QemuOpts *opts, int port_offset) { struct addrinfo ai,*res,*e; const char *addr; @@ -216,6 +216,11 @@ listen: return slisten; } +int inet_listen_opts(QemuOpts *opts) +{ + return do_inet_listen(opts, 0); +} + int inet_connect_opts(QemuOpts *opts) { struct addrinfo ai,*res,*e; @@ -465,7 +470,7 @@ int inet_listen(const char *str, char *ostr, int olen, opts = qemu_opts_create(&dummy_opts, NULL, 0); if (inet_parse(opts, str) == 0) { - sock = inet_listen_opts(opts, port_offset); + sock = do_inet_listen(opts, port_offset); if (sock != -1 && ostr) { optstr = strchr(str, ','); if (qemu_opt_get_bool(opts, "ipv6", 0)) { diff --git a/qemu_socket.h b/qemu_socket.h index 86bdbf5..fd8b95b 100644 --- a/qemu_socket.h +++ b/qemu_socket.h @@ -38,7 +38,7 @@ void socket_set_nonblock(int fd); int send_all(int fd, const void *buf, int len1); /* New, ipv6-ready socket helper functions, see qemu-sockets.c */ -int inet_listen_opts(QemuOpts *opts, int port_offset); +int inet_listen_opts(QemuOpts *opts); int inet_listen(const char *str, char *ostr, int olen, int socktype, int port_offset); int inet_connect_opts(QemuOpts *opts);