ia64/xen-unstable

changeset 16996:3821e39cc1a0

ioemu: config cleanup re AF_UNIX sockets on non-Windows

Here is what I wrote in my submission to qemu upstream:

The patch below makes it possible to disable AF_UNIX (unix-domain)
sockets in host environments which do not define _WIN32, by adding
-DNO_UNIX_SOCKETS to the compiler flags. This is useful in the
effectively-embedded qemu host which are going to be using for device
emulation in Xen.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 07 09:19:12 2008 +0000 (2008-02-07)
parents 0672d5b11262
children 45b2e7d59e3a
files tools/ioemu/qemu_socket.h tools/ioemu/vl.c tools/ioemu/vnc.c
line diff
     1.1 --- a/tools/ioemu/qemu_socket.h	Thu Feb 07 09:16:20 2008 +0000
     1.2 +++ b/tools/ioemu/qemu_socket.h	Thu Feb 07 09:19:12 2008 +0000
     1.3 @@ -14,12 +14,19 @@
     1.4  #define EINTR       WSAEINTR
     1.5  #define EINPROGRESS WSAEINPROGRESS
     1.6  
     1.7 +#ifndef NO_UNIX_SOCKETS
     1.8 +#define NO_UNIX_SOCKETS 1
     1.9 +#endif
    1.10 +
    1.11  #else
    1.12  
    1.13  #include <sys/socket.h>
    1.14  #include <netinet/in.h>
    1.15  #include <netinet/tcp.h>
    1.16 +
    1.17 +#ifndef NO_UNIX_SOCKETS
    1.18  #include <sys/un.h>
    1.19 +#endif
    1.20  
    1.21  #define socket_error() errno
    1.22  #define closesocket(s) close(s)
     2.1 --- a/tools/ioemu/vl.c	Thu Feb 07 09:16:20 2008 +0000
     2.2 +++ b/tools/ioemu/vl.c	Thu Feb 07 09:19:12 2008 +0000
     2.3 @@ -3127,7 +3127,7 @@ int parse_host_port(struct sockaddr_in *
     2.4      return 0;
     2.5  }
     2.6  
     2.7 -#ifndef _WIN32
     2.8 +#ifndef NO_UNIX_SOCKETS
     2.9  static int parse_unix_path(struct sockaddr_un *uaddr, const char *str)
    2.10  {
    2.11      const char *p;
     3.1 --- a/tools/ioemu/vnc.c	Thu Feb 07 09:16:20 2008 +0000
     3.2 +++ b/tools/ioemu/vnc.c	Thu Feb 07 09:19:12 2008 +0000
     3.3 @@ -2401,7 +2401,7 @@ int vnc_display_open(DisplayState *ds, c
     3.4  	}
     3.5  #endif
     3.6      }
     3.7 -#ifndef _WIN32
     3.8 +#ifndef NO_UNIX_SOCKETS
     3.9      if (strstart(display, "unix:", &p)) {
    3.10  	addr = (struct sockaddr *)&uaddr;
    3.11  	addrlen = sizeof(uaddr);