vhost-user-bridge was introduced prior to the first vhost-user daemon in
contrib/, and has remained in tests/ ever since. Let's join it with its
friends. By moving it into its own subdir of contrib/, it's granted
coverage in MAINTAINERS under the vhost section, whereas in tests/ it
remains uncovered and somewhat out of place.
Since vhost-user daemons in contrib have sections in the
vhost-user-contrib doc, let's add a section for vubr there. The section
as proposed doesn't fully cover all of vhost-user-bridge's capabilities;
for example, in aef8486ede8b Marc-André added a client mode to vubr that
is, for now, left unmentioned in the doc.
To complete the move, changes were made to the tests/ and root
meson.build files in addition to the new one in
contrib/vhost-user-bridge/.
The second patch was the subject of the first RFC. It introduces a basic
functional test of vubr in the same spirit as the testing mentioned for
it in vubr's initial commit, 3595e2eb0a23 (I had the wrong commit hash
in v1 of the RFC, my apologies). Initially, we used wget in the guest to
make an http request to an external host. This proved to be the wrong
tack, and I want to thank Marc-André for pointing that out and Thomas
for suggesting the alternative methods to eliminate the external host
dependency that are now used by the test.
The test is described in its header and commit message, but in short:
the guest serves a file to the host via http, and the host serves a file
to the guest via tftp.
I should mention that the guest kernel image has since been modified to
add python in the guest to be able to serve http. Also, the buildroot
option to enable DHCP on boot is now included. As before, please see:
https://github.com/yodel/vhost-user-bridge-test
for the kernel and initramfs combined image and associated build files.
For the last patch, adding an RX hexdump to complement the existing
transmit hexdump proved helpful to me when I was going through vubr's
logs, and I think it may be helpful to others. I'm not sure if there's a
reason for its omission besides time-constraints or simply being
overlooked, so please let me know otherwise?
I think the test patch (two) is probably ready for pulling but am, as
always, open to suggestions for improvements/fixes; as for its line in
MAINTAINERS, I placed it under vhost after Michael's comment in the RFC
(thank you, Michael), but perhaps the suggestion was meant only for
vhost-user-bridge.c and not the functional test. Please let me know if
the vhost section is the right place for the test or not?
And as before, thank you Cédric for having encouraged me to write the
test in the first place, and now for having Cc-ed Marc-André.
Link to RFCv1:
https://lore.kernel.org/qemu-devel/[email protected]/
Changes since RFCv1:
- Remove external host dependency (Marc-André)
- Replace wget to external host with http and tftp between guest and
host (Thomas)
- Use hardcoded UUIDs in the guest and a scratch file on the host for
data transfer
- Use a Popen context manager to terminate and wait on vubr (this isn't
necessary now, because vubr terminates when the connected guest shuts
down, but I suppose it could be with future changes to vubr)
- Add line in MAINTAINERS (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
Thanks,
Yodel
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 +
.../x86_64/test_vhost_user_bridge.py | 147 ++++++++++++++++++
tests/meson.build | 6 -
7 files changed, 199 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
--
2.52.0