From: Ian Molton <ian.molton@collabora.co.uk>
To: qemu-devel@nongnu.org
Cc: Ian Molton <ian.molton@collabora.co.uk>
Subject: [Qemu-devel] [PATCH 1/4] socket: Rationalise function declarations
Date: Thu, 17 Dec 2009 16:44:52 +0000 [thread overview]
Message-ID: <1261068295-25831-2-git-send-email-ian.molton@collabora.co.uk> (raw)
In-Reply-To: <1261068295-25831-1-git-send-email-ian.molton@collabora.co.uk>
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 <ian.molton@collabora.co.uk>
---
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);
--
1.6.5.4
next prev parent reply other threads:[~2009-12-17 16:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-17 16:44 [Qemu-devel] [PATCH] Virtio RNG and socket reconnect patchset Ian Molton
2009-12-17 16:44 ` Ian Molton [this message]
2009-12-17 16:44 ` [Qemu-devel] [PATCH 2/4] socket: Add a reconnect option Ian Molton
2009-12-17 16:44 ` [Qemu-devel] [PATCH 3/4] Add SIZE type to qdev properties Ian Molton
2009-12-17 16:44 ` [Qemu-devel] [PATCH 4/4] virtio: Add virtio-rng driver Ian Molton
[not found] ` <4B37DFDF.6000902@collabora.co.uk>
2010-01-04 20:53 ` [Qemu-devel] [PATCH 1/4] socket: Rationalise function declarations Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1261068295-25831-2-git-send-email-ian.molton@collabora.co.uk \
--to=ian.molton@collabora.co.uk \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).