Skip to contentSkip to conversation

tests/vhost-user-bridge: move to contrib/

PATCH Superseded Laurent Vivier 5 participants 13 messages Feb 7, 2020 – Mar 2, 2020 Kbuild

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 tests/vhost-user-bridge: move to contrib/

vhost-user-bridge is not a test. Move it to contrib/ and add it to the tools list.

It will be built only if tools (--enable-tools) and vhost-user (--enable-vhost-user) are enabled (both are set by default).

---

Notes:
v2: update docs

 Makefile                                                      | 3 +++
 Makefile.objs                                                 | 1 +
 configure                                                     | 3 +++
 contrib/vhost-user-bridge/Makefile.objs                       | 1 +
 tests/vhost-user-bridge.c => contrib/vhost-user-bridge/main.c | 0
 docs/devel/migration.rst                                      | 2 +-
 tests/Makefile.include                                        | 1 -
 7 files changed, 9 insertions(+), 2 deletions(-)
 create mode 100644 contrib/vhost-user-bridge/Makefile.objs
 rename tests/vhost-user-bridge.c => contrib/vhost-user-bridge/main.c (100%)
Makefile +3 -0
index 461d40bea6c2..23342a433e11 100644
@@ -442,6 +442,7 @@ dummy := $(call unnest-vars,, \
                 libvhost-user-obj-y \
                 vhost-user-scsi-obj-y \
                 vhost-user-blk-obj-y \
+                vhost-user-bridge-obj-y \
                 vhost-user-input-obj-y \
                 vhost-user-gpu-obj-y \
                 qga-vss-dll-obj-y \
@@ -672,6 +673,8 @@ vhost-user-scsi$(EXESUF): $(vhost-user-scsi-obj-y) libvhost-user.a
 	$(call LINK, $^)
 vhost-user-blk$(EXESUF): $(vhost-user-blk-obj-y) libvhost-user.a
 	$(call LINK, $^)
+vhost-user-bridge$(EXESUF): $(vhost-user-bridge-obj-y) libvhost-user.a
+	$(call LINK, $^)
 
 rdmacm-mux$(EXESUF): LIBS += "-libumad"
 rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS)
Makefile.objs +1 -0
index 26b9cff95436..0240100b9a17 100644
@@ -109,6 +109,7 @@ vhost-user-scsi.o-cflags := $(LIBISCSI_CFLAGS)
 vhost-user-scsi.o-libs := $(LIBISCSI_LIBS)
 vhost-user-scsi-obj-y = contrib/vhost-user-scsi/
 vhost-user-blk-obj-y = contrib/vhost-user-blk/
+vhost-user-bridge-obj-y = contrib/vhost-user-bridge/
 rdmacm-mux-obj-y = contrib/rdmacm-mux/
 vhost-user-input-obj-y = contrib/vhost-user-input/
 vhost-user-gpu-obj-y = contrib/vhost-user-gpu/
configure +3 -0
index 115dc38085f3..0415eb5c99d3 100755
@@ -6223,6 +6223,9 @@ if test "$want_tools" = "yes" ; then
   if [ "$curl" = "yes" ]; then
       tools="elf2dmp\$(EXESUF) $tools"
   fi
+  if [ "$vhost_user" = "yes" ]; then
+      tools="vhost-user-bridge\$(EXESUF) $tools"
+  fi
 fi
 if test "$softmmu" = yes ; then
   if test "$linux" = yes; then
contrib/vhost-user-bridge/Makefile.objs new file +1 -0
new file mode 100644
index 000000000000..36a8d9b49a05
@@ -0,0 +1 @@
+vhost-user-bridge-obj-y = main.o
contrib/vhost-user-bridge/main.c renamed from tests/vhost-user-bridge.c +0 -0
similarity index 100%
rename from tests/vhost-user-bridge.c
rename to contrib/vhost-user-bridge/main.c
docs/devel/migration.rst +1 -1
index e88918f7639e..d00424460e23 100644
@@ -807,7 +807,7 @@ The Linux kernel userfault support works on `/dev/shm` memory and on `hugetlbfs`
 for hugetlbfs which may be a problem in some configurations).
 
 The vhost-user code in QEMU supports clients that have Postcopy support,
-and the `vhost-user-bridge` (in `tests/`) and the DPDK package have changes
+and the `vhost-user-bridge` (in `contrib/`) and the DPDK package have changes
 to support postcopy.
 
 The client needs to open a userfaultfd and register the areas
tests/Makefile.include +0 -1
index 2f1cafed720d..78cdbe91aed5 100644
@@ -586,7 +586,6 @@ include $(SRC_PATH)/tests/qtest/Makefile.include
 
 tests/test-qga$(EXESUF): qemu-ga$(EXESUF)
 tests/test-qga$(EXESUF): tests/test-qga.o $(qtest-obj-y)
-tests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o $(test-util-obj-y) libvhost-user.a
 
 SPEED = quick
 
Signature · 1 line
2.24.1
#1 lore raw

PATCH v2 2/2 virtiofsd: add it to the tools list

it will be built only when tools are enabled (always enabled by default)

---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 23342a433e11..484fbb737858 100644
@@ -327,7 +327,7 @@ HELPERS-y += vhost-user-gpu$(EXESUF)
 vhost-user-json-y += contrib/vhost-user-gpu/50-qemu-gpu.json
 endif
 
-ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
+ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_TOOLS),yyyy)
 HELPERS-y += virtiofsd$(EXESUF)
 vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
 endif
@@ -681,7 +681,7 @@ rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS)
 	$(call LINK, $^)
 
 # relies on Linux-specific syscalls
-ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
+ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG)$(CONFIG_TOOLS),yyyy)
 virtiofsd$(EXESUF): $(virtiofsd-obj-y) libvhost-user.a $(COMMON_LDADDS)
 	$(call LINK, $^)
 endif
Signature · 1 line
2.24.1
Reviewed-by on v2 1/2
#4 lore raw
In reply to Laurent Vivier
Quoted 10 lines · Laurent Vivier

vhost-user-bridge is not a test. Move it to contrib/ and add it to the tools list.

It will be built only if tools (--enable-tools) and vhost-user (--enable-vhost-user) are enabled (both are set by default).

Reviewed-by on v2 1/2
#5 lore raw
In reply to Laurent Vivier
Quoted 15 lines · Laurent Vivier

vhost-user-bridge is not a test. Move it to contrib/ and add it to the tools list.

It will be built only if tools (--enable-tools) and vhost-user (--enable-vhost-user) are enabled (both are set by default).

---

Notes:
v2: update docs

Quoted 10 lines
 Makefile                                                      | 3 +++
 Makefile.objs                                                 | 1 +
 configure                                                     | 3 +++
 contrib/vhost-user-bridge/Makefile.objs                       | 1 +
 tests/vhost-user-bridge.c => contrib/vhost-user-bridge/main.c | 0
 docs/devel/migration.rst                                      | 2 +-
 tests/Makefile.include                                        | 1 -
 7 files changed, 9 insertions(+), 2 deletions(-)
 create mode 100644 contrib/vhost-user-bridge/Makefile.objs
 rename tests/vhost-user-bridge.c => contrib/vhost-user-bridge/main.c (100%)
#6 lore raw
In reply to Laurent Vivier
Quoted 10 lines · Laurent Vivier

vhost-user-bridge is not a test. Move it to contrib/ and add it to the tools list.

It will be built only if tools (--enable-tools) and vhost-user (--enable-vhost-user) are enabled (both are set by default).

I had to drop this series from my tree since it cause failures on OSX. Pls use something like travis CI to test when you repost a fixed version. Thanks!

Quoted 101 lines

---

Notes:
v2: update docs

 Makefile                                                      | 3 +++
 Makefile.objs                                                 | 1 +
 configure                                                     | 3 +++
 contrib/vhost-user-bridge/Makefile.objs                       | 1 +
 tests/vhost-user-bridge.c => contrib/vhost-user-bridge/main.c | 0
 docs/devel/migration.rst                                      | 2 +-
 tests/Makefile.include                                        | 1 -
 7 files changed, 9 insertions(+), 2 deletions(-)
 create mode 100644 contrib/vhost-user-bridge/Makefile.objs
 rename tests/vhost-user-bridge.c => contrib/vhost-user-bridge/main.c (100%)
Makefile +3 -0
index 461d40bea6c2..23342a433e11 100644
@@ -442,6 +442,7 @@ dummy := $(call unnest-vars,, \
                 libvhost-user-obj-y \
                 vhost-user-scsi-obj-y \
                 vhost-user-blk-obj-y \
+                vhost-user-bridge-obj-y \
                 vhost-user-input-obj-y \
                 vhost-user-gpu-obj-y \
                 qga-vss-dll-obj-y \
@@ -672,6 +673,8 @@ vhost-user-scsi$(EXESUF): $(vhost-user-scsi-obj-y) libvhost-user.a
 	$(call LINK, $^)
 vhost-user-blk$(EXESUF): $(vhost-user-blk-obj-y) libvhost-user.a
 	$(call LINK, $^)
+vhost-user-bridge$(EXESUF): $(vhost-user-bridge-obj-y) libvhost-user.a
+	$(call LINK, $^)
 
 rdmacm-mux$(EXESUF): LIBS += "-libumad"
 rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS)
Makefile.objs +1 -0
index 26b9cff95436..0240100b9a17 100644
@@ -109,6 +109,7 @@ vhost-user-scsi.o-cflags := $(LIBISCSI_CFLAGS)
 vhost-user-scsi.o-libs := $(LIBISCSI_LIBS)
 vhost-user-scsi-obj-y = contrib/vhost-user-scsi/
 vhost-user-blk-obj-y = contrib/vhost-user-blk/
+vhost-user-bridge-obj-y = contrib/vhost-user-bridge/
 rdmacm-mux-obj-y = contrib/rdmacm-mux/
 vhost-user-input-obj-y = contrib/vhost-user-input/
 vhost-user-gpu-obj-y = contrib/vhost-user-gpu/
configure +3 -0
index 115dc38085f3..0415eb5c99d3 100755
@@ -6223,6 +6223,9 @@ if test "$want_tools" = "yes" ; then
   if [ "$curl" = "yes" ]; then
       tools="elf2dmp\$(EXESUF) $tools"
   fi
+  if [ "$vhost_user" = "yes" ]; then
+      tools="vhost-user-bridge\$(EXESUF) $tools"
+  fi
 fi
 if test "$softmmu" = yes ; then
   if test "$linux" = yes; then
contrib/vhost-user-bridge/Makefile.objs new file +1 -0
new file mode 100644
index 000000000000..36a8d9b49a05
@@ -0,0 +1 @@
+vhost-user-bridge-obj-y = main.o
contrib/vhost-user-bridge/main.c renamed from tests/vhost-user-bridge.c +0 -0
similarity index 100%
rename from tests/vhost-user-bridge.c
rename to contrib/vhost-user-bridge/main.c
docs/devel/migration.rst +1 -1
index e88918f7639e..d00424460e23 100644
@@ -807,7 +807,7 @@ The Linux kernel userfault support works on `/dev/shm` memory and on `hugetlbfs`
 for hugetlbfs which may be a problem in some configurations).
 
 The vhost-user code in QEMU supports clients that have Postcopy support,
-and the `vhost-user-bridge` (in `tests/`) and the DPDK package have changes
+and the `vhost-user-bridge` (in `contrib/`) and the DPDK package have changes
 to support postcopy.
 
 The client needs to open a userfaultfd and register the areas
tests/Makefile.include +0 -1
index 2f1cafed720d..78cdbe91aed5 100644
@@ -586,7 +586,6 @@ include $(SRC_PATH)/tests/qtest/Makefile.include
 
 tests/test-qga$(EXESUF): qemu-ga$(EXESUF)
 tests/test-qga$(EXESUF): tests/test-qga.o $(qtest-obj-y)
-tests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o $(test-util-obj-y) libvhost-user.a
 
 SPEED = quick
 
Signature · 1 line
2.24.1
#7 lore raw
Quoted 8 lines · Michael S. Tsirkin
Quoted 7 lines · Laurent Vivier

vhost-user-bridge is not a test. Move it to contrib/ and add it to the tools list.

It will be built only if tools (--enable-tools) and vhost-user (--enable-vhost-user) are enabled (both are set by default).

Quoted 9 lines
Quoted 3 lines

I had to drop this series from my tree since it cause failures on OSX. Pls use something like travis CI to test when you repost a fixed version. Thanks!

Do you have a link to the error logs?

Thanks,
Laurent

#8 lore raw
Quoted 19 lines · Laurent Vivier
Quoted 8 lines · Michael S. Tsirkin
Quoted 7 lines · Laurent Vivier

vhost-user-bridge is not a test. Move it to contrib/ and add it to the tools list.

It will be built only if tools (--enable-tools) and vhost-user (--enable-vhost-user) are enabled (both are set by default).

Quoted 9 lines
Quoted 3 lines

I had to drop this series from my tree since it cause failures on OSX. Pls use something like travis CI to test when you repost a fixed version. Thanks!

Quoted 4 lines

Do you have a link to the error logs?

Thanks,
Laurent

Peter sent me this:

Hi; this fails to build on OSX:

CC contrib/libvhost-user/libvhost-user.o
/Users/pm215/src/qemu-for-merges/contrib/libvhost-user/libvhost-user.c:27:10:
fatal error: 'sys/eventfd.h' file not found

#include <sys/eventfd.h>
         ^~~~~~~~~~~~~~~

In file included from /Users/pm215/src/qemu-for-merges/contrib/vhost-user-bridge/main.c:37:
/Users/pm215/src/qemu-for-merges/contrib/libvhost-user/libvhost-user.h:21:10:
fatal error: 'linux/vhost.h' file not found

#include <linux/vhost.h>
         ^~~~~~~~~~~~~~~

1 error generated.

thanks
-- PMM

But pls do test on OSX before reposting.

Signature · 1 line
MST
#9 lore raw
Quoted 40 lines · Michael S. Tsirkin
Quoted 19 lines · Laurent Vivier
Quoted 8 lines · Michael S. Tsirkin
Quoted 7 lines · Laurent Vivier

vhost-user-bridge is not a test. Move it to contrib/ and add it to the tools list.

It will be built only if tools (--enable-tools) and vhost-user (--enable-vhost-user) are enabled (both are set by default).

Quoted 9 lines
Quoted 3 lines

I had to drop this series from my tree since it cause failures on OSX. Pls use something like travis CI to test when you repost a fixed version. Thanks!

Quoted 4 lines

Do you have a link to the error logs?

Thanks,
Laurent

Peter sent me this:

Hi; this fails to build on OSX:

CC contrib/libvhost-user/libvhost-user.o
/Users/pm215/src/qemu-for-merges/contrib/libvhost-user/libvhost-user.c:27:10:
fatal error: 'sys/eventfd.h' file not found

#include <sys/eventfd.h>
         ^~~~~~~~~~~~~~~

In file included from /Users/pm215/src/qemu-for-merges/contrib/vhost-user-bridge/main.c:37:
/Users/pm215/src/qemu-for-merges/contrib/libvhost-user/libvhost-user.h:21:10:
fatal error: 'linux/vhost.h' file not found

Quoted 9 lines
#include <linux/vhost.h>
         ^~~~~~~~~~~~~~~

1 error generated.

thanks
-- PMM

But pls do test on OSX before reposting.

Thank you.

I will fix and test the new patch with Travis CI.

Laurent

#10 lore raw
Quoted 48 lines · Laurent Vivier
Quoted 47 lines · Michael S. Tsirkin
Quoted 19 lines · Laurent Vivier
Quoted 8 lines · Michael S. Tsirkin
Quoted 7 lines · Laurent Vivier

vhost-user-bridge is not a test. Move it to contrib/ and add it to the tools list.

It will be built only if tools (--enable-tools) and vhost-user (--enable-vhost-user) are enabled (both are set by default).

Quoted 9 lines
Quoted 3 lines

I had to drop this series from my tree since it cause failures on OSX. Pls use something like travis CI to test when you repost a fixed version. Thanks!

Quoted 4 lines

Do you have a link to the error logs?

Thanks,
Laurent

Peter sent me this:

Hi; this fails to build on OSX:

CC contrib/libvhost-user/libvhost-user.o
/Users/pm215/src/qemu-for-merges/contrib/libvhost-user/libvhost-user.c:27:10:
fatal error: 'sys/eventfd.h' file not found

#include <sys/eventfd.h>
         ^~~~~~~~~~~~~~~

In file included from /Users/pm215/src/qemu-for-merges/contrib/vhost-user-bridge/main.c:37:
/Users/pm215/src/qemu-for-merges/contrib/libvhost-user/libvhost-user.h:21:10:
fatal error: 'linux/vhost.h' file not found

#include <linux/vhost.h>
         ^~~~~~~~~~~~~~~

1 error generated.

thanks
-- PMM

Quoted 6 lines
Quoted 2 lines

But pls do test on OSX before reposting.

Thank you.

I will fix and test the new patch with Travis CI.

In fact, travis was enabled when I sent the series but the QEMU .travis.yml disables the tools so the vhost-user-bridge was not built.

Thanks,
Laurent

#11 lore raw
Quoted 52 lines · Laurent Vivier
Quoted 51 lines · Laurent Vivier
Quoted 49 lines · Michael S. Tsirkin
Quoted 19 lines · Laurent Vivier
Quoted 8 lines · Michael S. Tsirkin
Quoted 7 lines · Laurent Vivier

vhost-user-bridge is not a test. Move it to contrib/ and add it to the tools list.

It will be built only if tools (--enable-tools) and vhost-user (--enable-vhost-user) are enabled (both are set by default).

Quoted 9 lines
Quoted 3 lines

I had to drop this series from my tree since it cause failures on OSX. Pls use something like travis CI to test when you repost a fixed version. Thanks!

Quoted 4 lines

Do you have a link to the error logs?

Thanks,
Laurent

Peter sent me this:

Hi; this fails to build on OSX:

CC contrib/libvhost-user/libvhost-user.o
/Users/pm215/src/qemu-for-merges/contrib/libvhost-user/libvhost-user.c:27:10:
fatal error: 'sys/eventfd.h' file not found

#include <sys/eventfd.h>
          ^~~~~~~~~~~~~~~

In file included from /Users/pm215/src/qemu-for-merges/contrib/vhost-user-bridge/main.c:37:
/Users/pm215/src/qemu-for-merges/contrib/libvhost-user/libvhost-user.h:21:10:
fatal error: 'linux/vhost.h' file not found

#include <linux/vhost.h>
          ^~~~~~~~~~~~~~~

1 error generated.

thanks
-- PMM

But pls do test on OSX before reposting.

Quoted 6 lines
Quoted 3 lines

Thank you.

I will fix and test the new patch with Travis CI.

In fact, travis was enabled when I sent the series but the QEMU .travis.yml disables the tools so the vhost-user-bridge was not built.

Can you send a patch to enable them?

Quoted 4 lines

Thanks,
Laurent

#12 lore raw
Quoted 55 lines · Philippe Mathieu-Daudé
Quoted 54 lines · Laurent Vivier
Quoted 53 lines · Laurent Vivier
Quoted 51 lines · Michael S. Tsirkin
Quoted 19 lines · Laurent Vivier
Quoted 8 lines · Michael S. Tsirkin
Quoted 7 lines · Laurent Vivier

vhost-user-bridge is not a test. Move it to contrib/ and add it to the tools list.

It will be built only if tools (--enable-tools) and vhost-user (--enable-vhost-user) are enabled (both are set by default).

Quoted 9 lines
Quoted 3 lines

I had to drop this series from my tree since it cause failures on OSX. Pls use something like travis CI to test when you repost a fixed version. Thanks!

Quoted 4 lines

Do you have a link to the error logs?

Thanks,
Laurent

Peter sent me this:

Hi; this fails to build on OSX:

   CC      contrib/libvhost-user/libvhost-user.o /Users/pm215/src/qemu-for-merges/contrib/libvhost-user/libvhost-user.c:27:10:

fatal error: 'sys/eventfd.h' file not found
#include <sys/eventfd.h>
          ^~~~~~~~~~~~~~~
In file included from /Users/pm215/src/qemu-for-merges/contrib/vhost-user-bridge/main.c:37:
/Users/pm215/src/qemu-for-merges/contrib/libvhost-user/libvhost-user.h:21:10:

fatal error: 'linux/vhost.h' file not found
#include <linux/vhost.h>
          ^~~~~~~~~~~~~~~
1 error generated.

thanks
-- PMM

But pls do test on OSX before reposting.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Thank you.

I will fix and test the new patch with Travis CI.

In fact, travis was enabled when I sent the series but the QEMU .travis.yml disables the tools so the vhost-user-bridge was not built.

Can you send a patch to enable them?

I don't know the best way to do that.

Perhaps to define a BASE_CONFIG with --enable-tools in "OSX Xcode 10.3" section?

Thanks,
Laurent