libvhost-user depends on sys/poll.h, sys/socket.h and eventfd. Although Windows has the equivalent Winsock, it doesn't have eventfd. So only enable this feature on Linux.
Signed-off-by: Coiby Xu <coiby...@gmail.com> --- Makefile | 1 + Makefile.objs | 2 +- Makefile.target | 1 + configure | 2 +- tests/Makefile.include | 5 ++++- 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6b5ad1121b..80c514f96b 100644 --- a/Makefile +++ b/Makefile @@ -558,6 +558,10 @@ qemu-img.o: qemu-img-cmds.h qemu-img$(EXESUF): qemu-img.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS) qemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS) + +ifdef CONFIG_LINUX +qemu-vu$(EXESUF): qemu-vu.o blockdev-vu.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS) libvhost-user.a +endif qemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS) qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o $(COMMON_LDADDS) diff --git a/Makefile.objs b/Makefile.objs index 7c1e50f9d6..5404daca00 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -53,6 +53,7 @@ common-obj-$(CONFIG_WIN32) += os-win32.o common-obj-$(CONFIG_POSIX) += os-posix.o common-obj-$(CONFIG_LINUX) += fsdev/ +common-obj-$(CONFIG_LINUX) += blockdev-vu.o common-obj-y += accel/ common-obj-y += migration/ diff --git a/Makefile.target b/Makefile.target index 6e61f607b1..d5405976ce 100644 --- a/Makefile.target +++ b/Makefile.target @@ -159,6 +159,9 @@ obj-y += monitor/ obj-y += qapi/ obj-y += memory.o obj-y += memory_mapping.o +ifdef CONFIG_LINUX +obj-y += ../contrib/libvhost-user/libvhost-user.o +endif obj-y += migration/ram.o LIBS := $(libs_softmmu) $(LIBS) diff --git a/configure b/configure index 0ce2c0354a..8ad4da57be 100755 --- a/configure +++ b/configure @@ -6169,6 +6169,9 @@ if test "$want_tools" = "yes" ; then if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then tools="qemu-nbd\$(EXESUF) $tools" fi + if [ "$linux" = "yes" ] ; then + tools="qemu-vu\$(EXESUF) $tools" + fi if [ "$ivshmem" = "yes" ]; then tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools" fi diff --git a/tests/Makefile.include b/tests/Makefile.include index 49e3b0d319..33bd48247b 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -746,6 +746,7 @@ qos-test-obj-y += tests/libqos/virtio.o qos-test-obj-$(CONFIG_VIRTFS) += tests/libqos/virtio-9p.o qos-test-obj-y += tests/libqos/virtio-balloon.o qos-test-obj-y += tests/libqos/virtio-blk.o +qos-test-obj-y += tests/libqos/vhost-user-blk.o qos-test-obj-y += tests/libqos/virtio-mmio.o qos-test-obj-y += tests/libqos/virtio-net.o qos-test-obj-y += tests/libqos/virtio-pci.o @@ -788,6 +789,7 @@ qos-test-obj-$(CONFIG_VHOST_NET_USER) += tests/vhost-user-test.o $(chardev-obj-y qos-test-obj-y += tests/virtio-test.o qos-test-obj-$(CONFIG_VIRTFS) += tests/virtio-9p-test.o qos-test-obj-y += tests/virtio-blk-test.o +qos-test-obj-$(CONFIG_LINUX) += tests/vhost-user-blk-test.o qos-test-obj-y += tests/virtio-net-test.o qos-test-obj-y += tests/virtio-rng-test.o qos-test-obj-y += tests/virtio-scsi-test.o @@ -935,7 +937,8 @@ endef $(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: %-softmmu/all $(check-qtest-y) $(call do_test_human,$(check-qtest-$*-y) $(check-qtest-generic-y), \ QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \ - QTEST_QEMU_IMG=qemu-img$(EXESUF)) + QTEST_QEMU_IMG=./qemu-img$(EXESUF) \ + QTEST_QEMU_VU_BINARY=./qemu-vu$(EXESUF)) check-unit: $(check-unit-y) $(call do_test_human, $^) -- 2.24.1