Skip to contentSkip to conversation

[7021] native preadv/pwritev support (Christoph Hellwig)

Qemu-devel Anthony Liguori 1 participant 1 message Apr 7, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 7021

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7021
Author:   aliguori
Date:     2009-04-07 18:43:28 +0000 (Tue, 07 Apr 2009)

Log Message:
-----------
native preadv/pwritev support (Christoph Hellwig)

This ties up the preadv/pwritev syscalls to qemu if they are declared in unistd.h. This is the case currently on at least NetBSD and OpenBSD and will hopefully soon be the case on Linux.

Thanks to Blue Swirl and Gerd Hoffmann for the configure autodetection of preadv/pwritev.

Modified Paths:
--------------
trunk/block.c
trunk/configure
trunk/posix-aio-compat.c

Modified: trunk/block.c
===================================================================

block.c +1 -2
@@ -1354,10 +1354,9 @@
 {
     BlockDriverAIOCBSync *acb = opaque;
 
-    qemu_vfree(acb->bounce);
-
     if (!acb->is_write)
         qemu_iovec_from_buffer(acb->qiov, acb->bounce, acb->qiov->size);
+    qemu_vfree(acb->bounce);
     acb->common.cb(acb->common.opaque, acb->ret);
 
     qemu_aio_release(acb);

Modified: trunk/configure
===================================================================

configure +17 -0
@@ -1108,6 +1108,19 @@
 fi
 
 ##########################################
+# preadv probe
+cat > $TMPC <<EOF
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <unistd.h>
+int main(void) { preadv; }
+EOF
+preadv=no
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
+  preadv=yes
+fi
+
+##########################################
 # fdt probe
 if test "$fdt" = "yes" ; then
     fdt=no
@@ -1221,6 +1234,7 @@
 echo "Install blobs     $blobs"
 echo "KVM support       $kvm"
 echo "fdt support       $fdt"
+echo "preadv support    $preadv"
 
 if test $sdl_too_old = "yes"; then
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -1522,6 +1536,9 @@
 if test "$iovec" = "yes" ; then
   echo "#define HAVE_IOVEC 1" >> $config_h
 fi
+if test "$preadv" = "yes" ; then
+  echo "#define HAVE_PREADV 1" >> $config_h
+fi
 if test "$fdt" = "yes" ; then
   echo "#define HAVE_FDT 1" >> $config_h
   echo "FDT_LIBS=-lfdt" >> $config_mak

Modified: trunk/posix-aio-compat.c
===================================================================

posix-aio-compat.c +83 -2

113 lines not on this page · raw message