Skip to contentSkip to conversation

ioemu: config cleanup re AF_UNIX sockets on non-Windows

PATCH New Ian Jackson 1 participant 1 message Feb 6, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ioemu: config cleanup re AF_UNIX sockets on non-Windows

This patch was submitted upstream to qemu but has not yet been accepted or rejected there. This change ought probably to be made to xen-unstable now to help support stub domains.

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.

Note that the change I submit below does _not_ engage this change for minios.

The patch should be applied with
cd tools/ioemu/
patch -p0 <.../qemu-allow-no-unix-sockets.patch

Ian.

Index: qemu_socket.h
===================================================================
RCS file: /sources/qemu/qemu/qemu_socket.h,v
retrieving revision 1.3

qemu_socket.h +7 -0
diff -u -r1.3 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)

Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.401

vl.c +1 -1
diff -u -r1.401 vl.c
@@ -3600,7 +3600,7 @@
     return 0;
 }
 
-#ifndef _WIN32
+#ifndef NO_UNIX_SOCKETS
 static int parse_unix_path(struct sockaddr_un *uaddr, const char *str)
 {
     const char *p;

Index: vnc.c
===================================================================
RCS file: /sources/qemu/qemu/vnc.c,v
retrieving revision 1.33

vnc.c +1 -1
diff -u -r1.33 vnc.c
@@ -2179,7 +2179,7 @@
 	}
 #endif
     }
-#ifndef _WIN32
+#ifndef NO_UNIX_SOCKETS
     if (strstart(display, "unix:", &p)) {
 	addr = (struct sockaddr *)&uaddr;
 	addrlen = sizeof(uaddr);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel