提交 4dd75c70 编写于 作者: C Christoph Hellwig 提交者: Anthony Liguori

make pthreads mandatory

As requested by Anthony make pthreads mandatory.  This means we will always
have AIO available on posix hosts, and it will also allow enabling the I/O
thread unconditionally once it's ready.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 3987e1cf
...@@ -55,7 +55,7 @@ recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES) ...@@ -55,7 +55,7 @@ recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o
block-obj-y += nbd.o block.o aio.o aes.o osdep.o block-obj-y += nbd.o block.o aio.o aes.o osdep.o
block-obj-$(CONFIG_AIO) += posix-aio-compat.o block-obj-$(CONFIG_POSIX) += posix-aio-compat.o
block-nested-y += cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o block-nested-y += cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o
......
...@@ -27,9 +27,7 @@ ...@@ -27,9 +27,7 @@
#include "qemu-log.h" #include "qemu-log.h"
#include "block_int.h" #include "block_int.h"
#include "module.h" #include "module.h"
#ifdef CONFIG_AIO
#include "posix-aio-compat.h" #include "posix-aio-compat.h"
#endif
#ifdef CONFIG_COCOA #ifdef CONFIG_COCOA
#include <paths.h> #include <paths.h>
...@@ -489,7 +487,6 @@ static int raw_write(BlockDriverState *bs, int64_t sector_num, ...@@ -489,7 +487,6 @@ static int raw_write(BlockDriverState *bs, int64_t sector_num,
return ret; return ret;
} }
#ifdef CONFIG_AIO
/***********************************************************/ /***********************************************************/
/* Unix AIO using POSIX AIO */ /* Unix AIO using POSIX AIO */
...@@ -725,13 +722,6 @@ static BlockDriverAIOCB *raw_aio_writev(BlockDriverState *bs, ...@@ -725,13 +722,6 @@ static BlockDriverAIOCB *raw_aio_writev(BlockDriverState *bs,
} }
return &acb->common; return &acb->common;
} }
#else /* CONFIG_AIO */
static int posix_aio_init(void)
{
return 0;
}
#endif /* CONFIG_AIO */
static void raw_close(BlockDriverState *bs) static void raw_close(BlockDriverState *bs)
{ {
...@@ -906,10 +896,8 @@ static BlockDriver bdrv_raw = { ...@@ -906,10 +896,8 @@ static BlockDriver bdrv_raw = {
.bdrv_create = raw_create, .bdrv_create = raw_create,
.bdrv_flush = raw_flush, .bdrv_flush = raw_flush,
#ifdef CONFIG_AIO
.bdrv_aio_readv = raw_aio_readv, .bdrv_aio_readv = raw_aio_readv,
.bdrv_aio_writev = raw_aio_writev, .bdrv_aio_writev = raw_aio_writev,
#endif
.bdrv_truncate = raw_truncate, .bdrv_truncate = raw_truncate,
.bdrv_getlength = raw_getlength, .bdrv_getlength = raw_getlength,
...@@ -1026,7 +1014,7 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags) ...@@ -1026,7 +1014,7 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
#endif #endif
s->type = FTYPE_FILE; s->type = FTYPE_FILE;
#if defined(__linux__) && defined(CONFIG_AIO) #if defined(__linux__)
if (strstart(filename, "/dev/sg", NULL)) { if (strstart(filename, "/dev/sg", NULL)) {
bs->sg = 1; bs->sg = 1;
} }
...@@ -1092,7 +1080,6 @@ static int hdev_ioctl(BlockDriverState *bs, unsigned long int req, void *buf) ...@@ -1092,7 +1080,6 @@ static int hdev_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
return ioctl(s->fd, req, buf); return ioctl(s->fd, req, buf);
} }
#ifdef CONFIG_AIO
static BlockDriverAIOCB *hdev_aio_ioctl(BlockDriverState *bs, static BlockDriverAIOCB *hdev_aio_ioctl(BlockDriverState *bs,
unsigned long int req, void *buf, unsigned long int req, void *buf,
BlockDriverCompletionFunc *cb, void *opaque) BlockDriverCompletionFunc *cb, void *opaque)
...@@ -1123,7 +1110,6 @@ static BlockDriverAIOCB *hdev_aio_ioctl(BlockDriverState *bs, ...@@ -1123,7 +1110,6 @@ static BlockDriverAIOCB *hdev_aio_ioctl(BlockDriverState *bs,
return &acb->common; return &acb->common;
} }
#endif
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
static int fd_open(BlockDriverState *bs) static int fd_open(BlockDriverState *bs)
...@@ -1183,10 +1169,8 @@ static BlockDriver bdrv_host_device = { ...@@ -1183,10 +1169,8 @@ static BlockDriver bdrv_host_device = {
.bdrv_create = hdev_create, .bdrv_create = hdev_create,
.bdrv_flush = raw_flush, .bdrv_flush = raw_flush,
#ifdef CONFIG_AIO
.bdrv_aio_readv = raw_aio_readv, .bdrv_aio_readv = raw_aio_readv,
.bdrv_aio_writev = raw_aio_writev, .bdrv_aio_writev = raw_aio_writev,
#endif
.bdrv_read = raw_read, .bdrv_read = raw_read,
.bdrv_write = raw_write, .bdrv_write = raw_write,
...@@ -1195,10 +1179,8 @@ static BlockDriver bdrv_host_device = { ...@@ -1195,10 +1179,8 @@ static BlockDriver bdrv_host_device = {
/* generic scsi device */ /* generic scsi device */
#ifdef __linux__ #ifdef __linux__
.bdrv_ioctl = hdev_ioctl, .bdrv_ioctl = hdev_ioctl,
#ifdef CONFIG_AIO
.bdrv_aio_ioctl = hdev_aio_ioctl, .bdrv_aio_ioctl = hdev_aio_ioctl,
#endif #endif
#endif
}; };
#ifdef __linux__ #ifdef __linux__
...@@ -1283,10 +1265,8 @@ static BlockDriver bdrv_host_floppy = { ...@@ -1283,10 +1265,8 @@ static BlockDriver bdrv_host_floppy = {
.bdrv_create = hdev_create, .bdrv_create = hdev_create,
.bdrv_flush = raw_flush, .bdrv_flush = raw_flush,
#ifdef CONFIG_AIO
.bdrv_aio_readv = raw_aio_readv, .bdrv_aio_readv = raw_aio_readv,
.bdrv_aio_writev = raw_aio_writev, .bdrv_aio_writev = raw_aio_writev,
#endif
.bdrv_read = raw_read, .bdrv_read = raw_read,
.bdrv_write = raw_write, .bdrv_write = raw_write,
...@@ -1365,10 +1345,8 @@ static BlockDriver bdrv_host_cdrom = { ...@@ -1365,10 +1345,8 @@ static BlockDriver bdrv_host_cdrom = {
.bdrv_create = hdev_create, .bdrv_create = hdev_create,
.bdrv_flush = raw_flush, .bdrv_flush = raw_flush,
#ifdef CONFIG_AIO
.bdrv_aio_readv = raw_aio_readv, .bdrv_aio_readv = raw_aio_readv,
.bdrv_aio_writev = raw_aio_writev, .bdrv_aio_writev = raw_aio_writev,
#endif
.bdrv_read = raw_read, .bdrv_read = raw_read,
.bdrv_write = raw_write, .bdrv_write = raw_write,
...@@ -1381,9 +1359,7 @@ static BlockDriver bdrv_host_cdrom = { ...@@ -1381,9 +1359,7 @@ static BlockDriver bdrv_host_cdrom = {
/* generic scsi device */ /* generic scsi device */
.bdrv_ioctl = hdev_ioctl, .bdrv_ioctl = hdev_ioctl,
#ifdef CONFIG_AIO
.bdrv_aio_ioctl = hdev_aio_ioctl, .bdrv_aio_ioctl = hdev_aio_ioctl,
#endif
}; };
#endif /* __linux__ */ #endif /* __linux__ */
...@@ -1488,10 +1464,8 @@ static BlockDriver bdrv_host_cdrom = { ...@@ -1488,10 +1464,8 @@ static BlockDriver bdrv_host_cdrom = {
.bdrv_create = hdev_create, .bdrv_create = hdev_create,
.bdrv_flush = raw_flush, .bdrv_flush = raw_flush,
#ifdef CONFIG_AIO
.bdrv_aio_readv = raw_aio_readv, .bdrv_aio_readv = raw_aio_readv,
.bdrv_aio_writev = raw_aio_writev, .bdrv_aio_writev = raw_aio_writev,
#endif
.bdrv_read = raw_read, .bdrv_read = raw_read,
.bdrv_write = raw_write, .bdrv_write = raw_write,
......
...@@ -196,8 +196,6 @@ build_docs="yes" ...@@ -196,8 +196,6 @@ build_docs="yes"
uname_release="" uname_release=""
curses="yes" curses="yes"
curl="yes" curl="yes"
pthread="yes"
aio="yes"
io_thread="no" io_thread="no"
nptl="yes" nptl="yes"
mixemu="no" mixemu="no"
...@@ -247,7 +245,6 @@ DragonFly) ...@@ -247,7 +245,6 @@ DragonFly)
bsd="yes" bsd="yes"
audio_drv_list="oss" audio_drv_list="oss"
audio_possible_drivers="oss sdl esd pa" audio_possible_drivers="oss sdl esd pa"
aio="no"
;; ;;
NetBSD) NetBSD)
bsd="yes" bsd="yes"
...@@ -347,7 +344,6 @@ if test "$mingw32" = "yes" ; then ...@@ -347,7 +344,6 @@ if test "$mingw32" = "yes" ; then
EXESUF=".exe" EXESUF=".exe"
QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS"
aio=no
fi fi
# find source path # find source path
...@@ -490,10 +486,6 @@ for opt do ...@@ -490,10 +486,6 @@ for opt do
;; ;;
--enable-mixemu) mixemu="yes" --enable-mixemu) mixemu="yes"
;; ;;
--disable-pthread) pthread="no"
;;
--disable-aio) aio="no"
;;
--enable-io-thread) io_thread="yes" --enable-io-thread) io_thread="yes"
;; ;;
--disable-blobs) blobs="no" --disable-blobs) blobs="no"
...@@ -630,8 +622,6 @@ echo " --oss-lib path to OSS library" ...@@ -630,8 +622,6 @@ echo " --oss-lib path to OSS library"
echo " --enable-uname-release=R Return R for uname -r in usermode emulation" echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
echo " --disable-vde disable support for vde network" echo " --disable-vde disable support for vde network"
echo " --disable-pthread disable pthread support"
echo " --disable-aio disable AIO support"
echo " --enable-io-thread enable IO thread" echo " --enable-io-thread enable IO thread"
echo " --disable-blobs disable installing provided firmware blobs" echo " --disable-blobs disable installing provided firmware blobs"
echo " --kerneldir=PATH look for kernel includes in PATH" echo " --kerneldir=PATH look for kernel includes in PATH"
...@@ -1171,24 +1161,25 @@ fi ...@@ -1171,24 +1161,25 @@ fi
# pthread probe # pthread probe
PTHREADLIBS_LIST="-lpthread -lpthreadGC2" PTHREADLIBS_LIST="-lpthread -lpthreadGC2"
if test "$pthread" = yes; then pthread=no
pthread=no
cat > $TMPC << EOF cat > $TMPC << EOF
#include <pthread.h> #include <pthread.h>
int main(void) { pthread_create(0,0,0,0); return 0; } int main(void) { pthread_create(0,0,0,0); return 0; }
EOF EOF
for pthread_lib in $PTHREADLIBS_LIST; do for pthread_lib in $PTHREADLIBS_LIST; do
if compile_prog "" "$pthread_lib" ; then if compile_prog "" "$pthread_lib" ; then
pthread=yes pthread=yes
LIBS="$pthread_lib $LIBS" LIBS="$pthread_lib $LIBS"
break break
fi fi
done done
fi
if test "$pthread" = no; then if test "$pthread" = no; then
aio=no echo
io_thread=no echo "Error: pthread check failed"
echo "Make sure to have the pthread libs and headers installed."
echo
exit 1
fi fi
########################################## ##########################################
...@@ -1520,7 +1511,6 @@ echo "uname -r $uname_release" ...@@ -1520,7 +1511,6 @@ echo "uname -r $uname_release"
echo "NPTL support $nptl" echo "NPTL support $nptl"
echo "GUEST_BASE $guest_base" echo "GUEST_BASE $guest_base"
echo "vde support $vde" echo "vde support $vde"
echo "AIO support $aio"
echo "IO thread $io_thread" echo "IO thread $io_thread"
echo "Install blobs $blobs" echo "Install blobs $blobs"
echo -e "KVM support $kvm" echo -e "KVM support $kvm"
...@@ -1692,9 +1682,6 @@ fi ...@@ -1692,9 +1682,6 @@ fi
if test "$xen" = "yes" ; then if test "$xen" = "yes" ; then
echo "CONFIG_XEN=y" >> $config_host_mak echo "CONFIG_XEN=y" >> $config_host_mak
fi fi
if test "$aio" = "yes" ; then
echo "CONFIG_AIO=y" >> $config_host_mak
fi
if test "$io_thread" = "yes" ; then if test "$io_thread" = "yes" ; then
echo "CONFIG_IOTHREAD=y" >> $config_host_mak echo "CONFIG_IOTHREAD=y" >> $config_host_mak
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册