mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
move socket_init to qemu-sockets.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
e9d0fc7463
commit
0706a4dcce
3 changed files with 25 additions and 24 deletions
24
vl.c
24
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;
|
||||
|
@ -3619,9 +3597,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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue