From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/3] move socket_init to qemu-sockets.c
Date: Wed, 31 Mar 2010 16:56:01 +0200 [thread overview]
Message-ID: <1270047363-12627-2-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1270047363-12627-1-git-send-email-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
qemu-sockets.c | 24 ++++++++++++++++++++++++
qemu_socket.h | 1 +
vl.c | 24 ------------------------
3 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/qemu-sockets.c b/qemu-sockets.c
index 23c3def..a7399aa 100644
--- a/qemu-sockets.c
+++ b/qemu-sockets.c
@@ -648,3 +648,27 @@ int unix_connect(const char *path)
}
#endif
+
+#ifdef _WIN32
+static void socket_cleanup(void)
+{
+ WSACleanup();
+}
+#endif
+
+int socket_init(void)
+{
+#ifdef _WIN32
+ WSADATA Data;
+ int ret, err;
+
+ ret = WSAStartup(MAKEWORD(2,2), &Data);
+ if (ret != 0) {
+ err = WSAGetLastError();
+ fprintf(stderr, "WSAStartup: %d\n", err);
+ return -1;
+ }
+ atexit(socket_cleanup);
+#endif
+ return 0;
+}
diff --git a/qemu_socket.h b/qemu_socket.h
index 7ee46ac..164ae3e 100644
--- a/qemu_socket.h
+++ b/qemu_socket.h
@@ -56,5 +56,6 @@ int parse_host_port(struct sockaddr_in *saddr, const char *str);
int parse_host_src_port(struct sockaddr_in *haddr,
struct sockaddr_in *saddr,
const char *str);
+int socket_init(void);
#endif /* QEMU_SOCKET_H */
diff --git a/vl.c b/vl.c
index 6768cf1..9ce6e4c 100644
--- a/vl.c
+++ b/vl.c
@@ -494,28 +494,6 @@ static void configure_rtc(QemuOpts *opts)
}
}
-#ifdef _WIN32
-static void socket_cleanup(void)
-{
- WSACleanup();
-}
-
-static int socket_init(void)
-{
- WSADATA Data;
- int ret, err;
-
- ret = WSAStartup(MAKEWORD(2,2), &Data);
- if (ret != 0) {
- err = WSAGetLastError();
- fprintf(stderr, "WSAStartup: %d\n", err);
- return -1;
- }
- atexit(socket_cleanup);
- return 0;
-}
-#endif
-
/***********************************************************/
/* Bluetooth support */
static int nb_hcis;
@@ -3622,9 +3600,7 @@ int main(int argc, char **argv, char **envp)
}
configure_icount(icount_option);
-#ifdef _WIN32
socket_init();
-#endif
if (net_init_clients() < 0) {
exit(1);
--
1.6.6.1
next prev parent reply other threads:[~2010-03-31 14:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-31 14:56 [Qemu-devel] [PATCH rebased 0/3] move stuff out of vl.c Paolo Bonzini
2010-03-31 14:56 ` Paolo Bonzini [this message]
2010-03-31 14:56 ` [Qemu-devel] [PATCH 2/3] move two variable declarations " Paolo Bonzini
2010-03-31 14:56 ` [Qemu-devel] [PATCH 3/3] move balloon handling to balloon.c Paolo Bonzini
2010-03-31 15:25 ` [Qemu-devel] [PATCH 4/3] move targphys.h and hw/poison.h inclusion to cpu-common.h Paolo Bonzini
2010-03-31 15:25 ` [Qemu-devel] [PATCH 5/3] compile balloon.c once Paolo Bonzini
2010-04-01 8:11 ` [Qemu-devel] " Paolo Bonzini
-- strict thread matches above, loose matches on Subject: below --
2010-03-19 10:35 [Qemu-devel] [PATCH 0/3] more vl.c/monitor.c splits Paolo Bonzini
2010-03-19 10:35 ` [Qemu-devel] [PATCH 1/3] move socket_init to qemu-sockets.c Paolo Bonzini
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=1270047363-12627-2-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--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).