Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L8gvZ-0005wB-9i for qemu-devel@nongnu.org; Fri, 05 Dec 2008 15:05:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L8gvY-0005vZ-N5 for qemu-devel@nongnu.org; Fri, 05 Dec 2008 15:05:28 -0500 Received: from [199.232.76.173] (port=47791 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L8gvY-0005vW-Cm for qemu-devel@nongnu.org; Fri, 05 Dec 2008 15:05:28 -0500 Received: from savannah.gnu.org ([199.232.41.3]:44344 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L8gvX-0003cN-V1 for qemu-devel@nongnu.org; Fri, 05 Dec 2008 15:05:28 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1L8gvX-0004QC-Hr for qemu-devel@nongnu.org; Fri, 05 Dec 2008 20:05:27 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1L8gvX-0004Q8-8Y for qemu-devel@nongnu.org; Fri, 05 Dec 2008 20:05:27 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Fri, 05 Dec 2008 20:05:27 +0000 Subject: [Qemu-devel] [5889] Make struct iovec universally available 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 Revision: 5889 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5889 Author: aliguori Date: 2008-12-05 20:05:26 +0000 (Fri, 05 Dec 2008) Log Message: ----------- Make struct iovec universally available Vectored IO APIs will require some sort of vector argument. It makes sense to use struct iovec and just define it globally for Windows. Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/configure trunk/hw/virtio.h trunk/qemu-common.h trunk/slirp/socket.c trunk/slirp/socket.h Modified: trunk/configure =================================================================== --- trunk/configure 2008-12-05 17:56:40 UTC (rev 5888) +++ trunk/configure 2008-12-05 20:05:26 UTC (rev 5889) @@ -1017,6 +1017,17 @@ fi fi +########################################## +# iovec probe +cat > $TMPC < +int main(void) { struct iovec iov; return 0; } +EOF +iovec=no +if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then + iovec=yes +fi + # Check if tools are available to build documentation. if [ -x "`which texi2html 2>/dev/null`" ] && \ [ -x "`which pod2man 2>/dev/null`" ]; then @@ -1376,6 +1387,9 @@ if test "$blobs" = "yes" ; then echo "INSTALL_BLOBS=yes" >> $config_mak fi +if test "$iovec" = "yes" ; then + echo "#define HAVE_IOVEC 1" >> $config_h +fi # XXX: suppress that if [ "$bsd" = "yes" ] ; then Modified: trunk/hw/virtio.h =================================================================== --- trunk/hw/virtio.h 2008-12-05 17:56:40 UTC (rev 5888) +++ trunk/hw/virtio.h 2008-12-05 20:05:26 UTC (rev 5889) @@ -17,15 +17,6 @@ #include "hw.h" #include "pci.h" -#ifdef _WIN32 -struct iovec { - void *iov_base; - size_t iov_len; -}; -#else -#include -#endif - /* from Linux's linux/virtio_config.h */ /* Status byte for guest to report progress, and synchronize features. */ Modified: trunk/qemu-common.h =================================================================== --- trunk/qemu-common.h 2008-12-05 17:56:40 UTC (rev 5888) +++ trunk/qemu-common.h 2008-12-05 20:05:26 UTC (rev 5889) @@ -16,6 +16,7 @@ #include #include #include +#include "config-host.h" #ifndef O_LARGEFILE #define O_LARGEFILE 0 @@ -28,6 +29,14 @@ #define ENOMEDIUM ENODEV #endif +#ifndef HAVE_IOVEC +#define HAVE_IOVEC +struct iovec { + void *iov_base; + size_t iov_len; +}; +#endif + #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #define WINVER 0x0501 /* needed for ipv6 bits */ @@ -54,7 +63,6 @@ /* FIXME: Remove NEED_CPU_H. */ #ifndef NEED_CPU_H -#include "config-host.h" #include #include "osdep.h" #include "bswap.h" Modified: trunk/slirp/socket.c =================================================================== --- trunk/slirp/socket.c 2008-12-05 17:56:40 UTC (rev 5888) +++ trunk/slirp/socket.c 2008-12-05 20:05:26 UTC (rev 5889) @@ -11,6 +11,7 @@ #ifdef __sun__ #include #endif +#include "qemu-common.h" static void sofcantrcvmore(struct socket *so); static void sofcantsendmore(struct socket *so); Modified: trunk/slirp/socket.h =================================================================== --- trunk/slirp/socket.h 2008-12-05 17:56:40 UTC (rev 5888) +++ trunk/slirp/socket.h 2008-12-05 20:05:26 UTC (rev 5889) @@ -73,14 +73,6 @@ extern struct socket tcb; - -#if defined(DECLARE_IOVEC) && !defined(HAVE_READV) -struct iovec { - char *iov_base; - size_t iov_len; -}; -#endif - struct socket * solookup _P((struct socket *, struct in_addr, u_int, struct in_addr, u_int)); struct socket * socreate _P((void)); void sofree _P((struct socket *));