Skip to content

Enable virtio-fs and virtio-snd in UML

Benjamin Berg linux-um 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4um: virtio_uml: send SET_MEM_TABLE message with the exact sizearch/um/drivers/virtio_uml.c+1 -10 replies
2/4um: virtio_uml: use smaller virtqueue sizes for VIRTIO_ID_SOUNDarch/um/drivers/virtio_uml.c+12 -11 reply
3/4um: virtio_uml: fix call_fd IRQ allocationarch/um/drivers/virtio_uml.c+10 -50 replies
4/4um: virtio_uml: query the number of vqs if supportedarch/um/drivers/vhost_user.h arch/um/drivers/virtio_uml.c+25 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] Enable virtio-fs and virtio-snd in UML

From: Benjamin Berg <[email protected]>

With these changes, both virtio-fs and virtio-snd seem to work fine. The feature to query the number of vqs is not really needed, but I already had the code.

You can for example boot a machine that has both by executing something like the following:

 $ virtiofsd --sandbox none --socket-path=/tmp/vfsd.sock \
             --shared-dir / --announce-submounts \
             --tag vfs0
 $ vhost-device-sound --socket /tmp/vsnd.sock --backend pipewire

And then simply launching a UML VM directly from /

 $ ./linux mem=256M init=/bin/sh \
           virtio_uml.device=/tmp/vfsd.sock:26 \
           virtio_uml.device=/tmp/vsnd.sock:25 \
           root=vfs0 rootfstype=virtiofs

If you want to do a quick sound check, you could e.g. run the following commands. The mount just avoids alsa configuration from the host to be picked up, which might have configuration to use pipewire by default.

 # mount -t tmpfs none /etc
 # arecord | aplay

For me, this works fine on F40 (virtiofsd is installed in /usr/libexec)

Benjamin

Benjamin Berg (4):
um: virtio_uml: send SET_MEM_TABLE message with the exact size
um: virtio_uml: use smaller virtqueue sizes for VIRTIO_ID_SOUND
um: virtio_uml: fix call_fd IRQ allocation
um: virtio_uml: query the number of vqs if supported

 arch/um/drivers/vhost_user.h |  4 ++-
 arch/um/drivers/virtio_uml.c | 53 ++++++++++++++++++++++++++++++------
 2 files changed, 48 insertions(+), 9 deletions(-)
Signature · 1 line
2.47.0