aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-02-07 09:19:12 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-02-07 09:19:12 +0000
commit7189dd2eeb4028b3810740afaca85473f4b51aa9 (patch)
tree4eaeea9c2723530e738c18d35ca0390d1e7e4656 /tools
parent9ea04252b60aeb6600e041a53100873b3f3a1a2e (diff)
downloadxen-7189dd2eeb4028b3810740afaca85473f4b51aa9.tar.gz
xen-7189dd2eeb4028b3810740afaca85473f4b51aa9.tar.bz2
xen-7189dd2eeb4028b3810740afaca85473f4b51aa9.zip
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/ioemu/qemu_socket.h7
-rw-r--r--tools/ioemu/vl.c2
-rw-r--r--tools/ioemu/vnc.c2
3 files changed, 9 insertions, 2 deletions
diff --git a/tools/ioemu/qemu_socket.h b/tools/ioemu/qemu_socket.h
index 6e8bcce6cf..d462d08d60 100644
--- a/tools/ioemu/qemu_socket.h
+++ b/tools/ioemu/qemu_socket.h
@@ -14,12 +14,19 @@
#define EINTR WSAEINTR
#define EINPROGRESS WSAEINPROGRESS
+#ifndef NO_UNIX_SOCKETS
+#define NO_UNIX_SOCKETS 1
+#endif
+
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
+
+#ifndef NO_UNIX_SOCKETS
#include <sys/un.h>
+#endif
#define socket_error() errno
#define closesocket(s) close(s)
diff --git a/tools/ioemu/vl.c b/tools/ioemu/vl.c
index 939149c46f..cb94bada09 100644
--- a/tools/ioemu/vl.c
+++ b/tools/ioemu/vl.c
@@ -3127,7 +3127,7 @@ int parse_host_port(struct sockaddr_in *saddr, const char *str)
return 0;
}
-#ifndef _WIN32
+#ifndef NO_UNIX_SOCKETS
static int parse_unix_path(struct sockaddr_un *uaddr, const char *str)
{
const char *p;
diff --git a/tools/ioemu/vnc.c b/tools/ioemu/vnc.c
index 11cd94479f..0dd78dd4b4 100644
--- a/tools/ioemu/vnc.c
+++ b/tools/ioemu/vnc.c
@@ -2401,7 +2401,7 @@ int vnc_display_open(DisplayState *ds, const char *display, int find_unused)
}
#endif
}
-#ifndef _WIN32
+#ifndef NO_UNIX_SOCKETS
if (strstart(display, "unix:", &p)) {
addr = (struct sockaddr *)&uaddr;
addrlen = sizeof(uaddr);