preadv/pwritev code for qemu
RFC PATCH 1/1 preadv/pwritev code for qemu
Hi,
You needs also the kernel patches if you wanna play with this on linux. On *BSD it should detect preadv being present and use it.
No code uses this (yet).
cheers,
Gerd
Quoted 1 line
From
8b640cab61853efa622e17bb9145fe242fffc5a4Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <[email protected]>
Date: Thu, 22 Jan 2009 16:22:41 +0100
Subject: [PATCH 3/3] preadv/writev code for qemu.
Signed-off-by Gerd Hoffmann <[email protected]>
--- Makefile | 1 + configure | 13 +++++ qemu-common.h | 3 + qemu-io-syscalls.c | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 169 insertions(+), 0 deletions(-) create mode 100644 qemu-io-syscalls.c
Makefile +1 -0
@@ -85,6 +85,7 @@ OBJS+=sd.o ssi-sd.o OBJS+=bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o OBJS+=buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o OBJS+=qemu-char.o aio.o net-checksum.o savevm.o cache-utils.o +OBJS+=qemu-io-syscalls.o ifdef CONFIG_BRLAPI OBJS+= baum.o
configure +13 -0
@@ -1027,6 +1027,16 @@ if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then fi ########################################## +# preadv probe +cat > $TMPC <<EOF +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
@@ -1422,6 +1432,9 @@ fi 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
qemu-common.h +3 -0
@@ -204,6 +204,9 @@ void qemu_iovec_destroy(QEMUIOVector *qiov);void qemu_iovec_to_buffer (QEMUIOVector *qiov,void *buf);void qemu_iovec_from_buffer (QEMUIOVector *qiov,const void *buf,size_t count); +ssize_t qemu_preadv (int fd,QEMUIOVector *qiov,off_t offset); +ssize_t qemu_pwritev (int fd,QEMUIOVector *qiov,off_t offset); +#endif /* dyngen-exec.h hack */ #endif
qemu-io-syscalls.c new file +152 -0
152 lines not on this page · raw message
Signature · 1 line
1.6.1