@samitouri / QOSamiQemu / commits / 42d2c1cc9e

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

After the introduction of vhost-user-bridge and libvhost-user, we formed the convention of placing vhost-user daemons in eponymous subdirs of contrib/. Follow this convention. Create a contrib/vhost-user-bridge/ directory and move vhost-user-bridge into it. Extract its build target definition from tests/meson.build into the new directory, and include its subdir in the root-level meson.build. Add a section about it in the "vhost-user daemons in contrib" document. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Yodel Eldar <yodel.eldar@yodel.dev> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260129133049.119829-2-yodel.eldar@yodel.dev>

Yodel Eldar committed Jan 29, 2026 at 07:30 UTC 42d2c1cc9e89b77f1287ed433c655bc9e98bdc41
5 files changed +44 -6
contrib/vhost-user-bridge/meson.build new
+4
@@ -0,0 +1,4 @@
1 +if have_tools and have_vhost_user and host_os == 'linux'
2 + executable('vhost-user-bridge', files('vhost-user-bridge.c'),
3 + dependencies: [qemuutil, vhost_user], install: false)
4 +endif
contrib/vhost-user-bridge/vhost-user-bridge.c renamed
docs/system/devices/virtio/vhost-user-contrib.rst
+39
@@ -85,3 +85,42 @@ vhost-user-scsi - SCSI controller
85
86 The vhost-user-scsi daemon can proxy iSCSI devices onto a virtualized
87 SCSI controller.
88 +
89 +.. _vhost_user_bridge:
90 +
91 +vhost-user-bridge - Network bridge
92 +==================================
93 +
94 +The vhost-user-bridge daemon serves as a development tool for testing real
95 +internet traffic by providing a networking backend, i.e. server, for the
96 +vhost-user protocol.
97 +
98 +Example
99 +-------
100 +For a single QEMU instance that both runs the user-mode net stack (slirp) and
101 +serves as a vhost-user protocol frontend, i.e. client, simultaneously:
102 +
103 +First, start vhost-user-bridge:
104 +
105 +::
106 +
107 + $ vhost-user-bridge -u /tmp/vubr.sock \
108 + -l 127.0.0.1:4444 \
109 + -r 127.0.0.1:5555
110 +
111 +Then, invoke QEMU:
112 +
113 +::
114 +
115 + $ qemu-system-x86_64 \
116 + -m 4G \
117 + -object memory-backend-memfd,id=mem0,size=4G,share=on,prealloc=on \
118 + -numa node,memdev=mem0 \
119 + -chardev socket,id=char0,path=/tmp/vubr.sock \
120 + -netdev vhost-user,id=vhost0,chardev=char0,vhostforce=on \
121 + -device virtio-net-pci,netdev=vhost0 \
122 + -netdev socket,id=udp0,udp=localhost:4444,localaddr=localhost:5555 \
123 + -netdev user,id=user0 \
124 + -netdev hubport,id=hub0,hubid=0,netdev=udp0 \
125 + -netdev hubport,id=hub1,hubid=0,netdev=user0 \
126 + ...
meson.build
+1
@@ -4504,6 +4504,7 @@ if have_tools
4504
4505 if have_vhost_user
4506 subdir('contrib/vhost-user-blk')
4507 + subdir('contrib/vhost-user-bridge')
4508 subdir('contrib/vhost-user-gpu')
4509 subdir('contrib/vhost-user-input')
4510 subdir('contrib/vhost-user-scsi')
tests/meson.build
-6
@@ -70,12 +70,6 @@ test_deps = {
70 'test-qht-par': qht_bench,
71 }
72
73 -if have_tools and have_vhost_user and host_os == 'linux'
74 - executable('vhost-user-bridge',
75 - sources: files('vhost-user-bridge.c'),
76 - dependencies: [qemuutil, vhost_user])
77 -endif
78 -
73 subdir('decode')
74
75 if 'CONFIG_TCG' in config_all_accel