Skip to content

vhost-user-bridge housekeeping and test

Yodel Eldar qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 4 repliesIn review
  2. v33 patches 0 repliesSuperseded
  3. v2 RFC3 patches 6 repliesSuperseded

Changes in v4 from the cover letter

--------------------
- Fix is_readable_executable_file() check of vubr for skipping test

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3tests/vhost-user-bridge: Move to contrib/vhost-user-bridge/contrib/vhost-user-bridge/meson.build contrib/vhost-user-bridge/vhost-user-bridge.c docs/system/devices/virtio/vhost-user-contrib.rst +2 more+44 -60 replies
2/3tests/functional/x86_64: Add vhost-user-bridge testMAINTAINERS tests/functional/x86_64/meson.build tests/functional/x86_64/test_vhost_user_bridge.py+149 -00 replies
3/3contrib/vhost-user-bridge: Add UDP receive hexdumpcontrib/vhost-user-bridge/vhost-user-bridge.c+7 -00 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchMarc-André LureauThomas Huth
1/3R-b
2/3R-b R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/3] vhost-user-bridge housekeeping and test

Hi,

The existence check of the vhost-user-bridge file checks for None when it should check for False to determine whether the test should be skipped; a trivial fix.

Changes since v3:
--------------------
- Fix is_readable_executable_file() check of vubr for skipping test

Link to v3:
-----------
https://lore.kernel.org/qemu-devel/[email protected]/

Thanks,
Yodel

Cover letter from v3:
=====================

This series (1) moves vhost-user-bridge (vubr) from tests/ to contrib/vhost-user-bridge/, (2) introduces a basic functional test of vubr, and (3) adds UDP receive packet logging to vubr:

Patch 1: Moving vhost-user-bridge
---------------------------------
After the introduction of vhost-user-bridge and libvhost-user, new vhost-user backend daemons were placed in dedicated subdirectories of contrib/. An F: line under the vhost section in MAINTAINERS grants these daemons coverage; in tests/, however, vhost-user-bridge lacks coverage and appears orphaned there. So, let's give it a home with the rest of the vhost-user backend family.

As part of the move, vhost-user-bridge also gains a section in the vhost-user-contrib document. More can be said about vubr there, like its client mode feature added in aef8486ede8b by Marc-André, but for now a short description and usage example will help folks interested in using the daemon to expand vhost-user support in QEMU.

Lastly, Patch 1 makes the necessary changes to the meson build files in tests/ and root, and the new one in contrib/vhost-user-bridge/.

Patch 2: Introducing a functional test
--------------------------------------
This test was inspired by discussions with Cédric regarding build errors from recent glibc const changes and was the subject of the first RFC.

The functional test introduced in the second patch starts vubr as a subprocess, then launches a single QEMU instance that provides a slirp stack and serves as the frontend of the vhost-user protocol, much like the testing setup described in vhost-user-bridge's initial commit in 3595e2eb0a23.

For additional details about the test, please see Patch 2's commit message and/or the test's header; in short: the host serves a file to the guest via tftp, then the guest serves a file to the host via http.

The guest's kernel image was built with Buildroot in a Containerfile that is based on a snapshot Debian container image, so that the kernel image remains bit-for-bit reproducible indefinitely. For the image and its build files, please see:
https://github.com/yodel/vhost-user-bridge-test
The repo will be placed in archive (read-only) mode if/when the series is pulled.

Patch 3: Adding UDP RX logging
------------------------------
An existing transmit hexdump of UDP packets provides valuable data; adding a receive hexdump to complement TX doubles the fun (read:
visibility). Like TX, the RX hexdump is gated behind a currently hardcoded-on macro. Another new debug print separates transmit blocks from receives.

Changes since RFCv2:
--------------------
- Promoted to PATCH
- Collect R-b's (thanks to Marc-André and Thomas)
- Add test to .../x86_64/meson.build thorough suite (Marc-André)
- Add encoding= args to open() (Thomas)
- Add pylint disable=unbalanced-tuple-unpacking on find_free_ports()
- Minor commit message rewording

Changes since RFCv1:
--------------------
- Remove external host dependency (Marc-André)
- Use user netdev tftp feature (Thomas)
- Use check_http_download (Thomas)
- Remove wget
- Inherit from LinuxKernelTest instead of QemuSystemTest
- Use hardcoded UUIDs in files on the guest and host for data transfer
- Use a Popen context manager to terminate and wait on vubr
- Add test to MAINTAINERS under the vhost section (Michael)
- New patch to move from tests/ to contrib/vhost-user-bridge/ and add docs section
- New patch to add RX debug logging in vhost-user-bridge.c

Links
-----
RFCv2:
https://lore.kernel.org/qemu-devel/[email protected]/
RFCv1:
https://lore.kernel.org/qemu-devel/[email protected]/

Yodel Eldar (3):
tests/vhost-user-bridge: Move to contrib/vhost-user-bridge/ tests/functional/x86_64: Add vhost-user-bridge test contrib/vhost-user-bridge: Add UDP receive hexdump

 MAINTAINERS                                   |   1 +
 contrib/vhost-user-bridge/meson.build         |   4 +
 .../vhost-user-bridge}/vhost-user-bridge.c    |   7 +
 .../devices/virtio/vhost-user-contrib.rst     |  39 +++++
 meson.build                                   |   1 +
 tests/functional/x86_64/meson.build           |   1 +
 .../x86_64/test_vhost_user_bridge.py          | 147 ++++++++++++++++++
 tests/meson.build                             |   6 -
 8 files changed, 200 insertions(+), 6 deletions(-)
 create mode 100644 contrib/vhost-user-bridge/meson.build
 rename {tests => contrib/vhost-user-bridge}/vhost-user-bridge.c (98%)
 create mode 100755 tests/functional/x86_64/test_vhost_user_bridge.py
Signature · 1 line
2.52.0