[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/5] socket: Rationalise function declarations
From: |
Ian Molton |
Subject: |
[Qemu-devel] [PATCH 1/5] socket: Rationalise function declarations |
Date: |
Mon, 1 Feb 2010 13:34:21 +0000 |
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 <address@hidden>
---
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 d912fed..7cfb6cf 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 7ee46ac..0cf96d9 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.6
- [Qemu-devel] [PATCH] resend: socket reconnect and virtio-rng support, Ian Molton, 2010/02/01
- [Qemu-devel] [PATCH 1/5] socket: Rationalise function declarations,
Ian Molton <=
- [Qemu-devel] [PATCH 2/5] socket: Add a reconnect option., Ian Molton, 2010/02/01
- [Qemu-devel] [PATCH 3/5] Add SIZE type to qdev properties, Ian Molton, 2010/02/01
- [Qemu-devel] [PATCH 4/5] virtio: Add virtio-rng driver, Ian Molton, 2010/02/01
- [Qemu-devel] [PATCH 5/5] Build fix (missing header), Ian Molton, 2010/02/01
- Re: [Qemu-devel] [PATCH 4/5] virtio: Add virtio-rng driver, Anthony Liguori, 2010/02/01
- Re: [Qemu-devel] [PATCH 4/5] virtio: Add virtio-rng driver, Gerd Hoffmann, 2010/02/01
- Re: [Qemu-devel] [PATCH 4/5] virtio: Add virtio-rng driver, Anthony Liguori, 2010/02/01
- Re: [Qemu-devel] [PATCH 4/5] virtio: Add virtio-rng driver, Ian Molton, 2010/02/01
- Re: [Qemu-devel] [PATCH 4/5] virtio: Add virtio-rng driver, Ian Molton, 2010/02/01
- Re: [Qemu-devel] [PATCH 4/5] virtio: Add virtio-rng driver, Ian Molton, 2010/02/09