Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JIPxT-0002M6-ME for qemu-devel@nongnu.org; Fri, 25 Jan 2008 09:55:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JIPxR-0002KY-Tf for qemu-devel@nongnu.org; Fri, 25 Jan 2008 09:55:07 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JIPxR-0002KK-LM for qemu-devel@nongnu.org; Fri, 25 Jan 2008 09:55:05 -0500 Received: from smtp02.citrix.com ([66.165.176.63]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JIPxR-000147-Fj for qemu-devel@nongnu.org; Fri, 25 Jan 2008 09:55:05 -0500 Received: from mariner.uk.xensource.com (mariner.uk.xensource.com [172.31.17.38]) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id m0PEsL8L008883 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 25 Jan 2008 06:54:23 -0800 Received: from iwj by mariner.uk.xensource.com with local (Exim 4.63) (envelope-from ) id 1JIPvZ-0001Q7-77 for qemu-devel@nongnu.org; Fri, 25 Jan 2008 14:53:09 +0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="tWfn2B4bmw" Content-Transfer-Encoding: 7bit Message-ID: <18329.63445.210933.809690@mariner.uk.xensource.com> Date: Fri, 25 Jan 2008 14:53:09 +0000 From: Ian Jackson Subject: [Qemu-devel] [PATCH] Allow AF_UNIX sockets to be disabled on non-Windows Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --tWfn2B4bmw Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit 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. Ian. --tWfn2B4bmw Content-Type: text/plain Content-Description: allow AF_UNIX sockets to be disabled Content-Disposition: inline; filename="qemu-allow-no-unix-sockets.patch" Content-Transfer-Encoding: 7bit Index: qemu_socket.h =================================================================== RCS file: /sources/qemu/qemu/qemu_socket.h,v retrieving revision 1.3 diff -u -r1.3 qemu_socket.h --- qemu_socket.h 17 Dec 2007 04:42:28 -0000 1.3 +++ qemu_socket.h 25 Jan 2008 14:40:19 -0000 @@ -14,12 +14,19 @@ #define EINTR WSAEINTR #define EINPROGRESS WSAEINPROGRESS +#ifndef NO_UNIX_SOCKETS +#define NO_UNIX_SOCKETS 1 +#endif + #else #include #include #include + +#ifndef NO_UNIX_SOCKETS #include +#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 diff -u -r1.401 vl.c --- vl.c 23 Jan 2008 19:01:12 -0000 1.401 +++ vl.c 25 Jan 2008 14:40:23 -0000 @@ -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 diff -u -r1.33 vnc.c --- vnc.c 14 Jan 2008 21:45:55 -0000 1.33 +++ vnc.c 25 Jan 2008 14:40:24 -0000 @@ -2179,7 +2179,7 @@ } #endif } -#ifndef _WIN32 +#ifndef NO_UNIX_SOCKETS if (strstart(display, "unix:", &p)) { addr = (struct sockaddr *)&uaddr; addrlen = sizeof(uaddr); --tWfn2B4bmw--