From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Albert Esteve <aesteve@redhat.com>
Cc: qemu-devel@nongnu.org, manos.pitsidianakis@linaro.org,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Cornelia Huck" <cohuck@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH 2/3] hw/display: add vhost-user-media device
Date: Tue, 30 Jun 2026 12:27:56 +0100 [thread overview]
Message-ID: <akOoPD_P51HDn-Jo@redhat.com> (raw)
In-Reply-To: <20260630112310.552606-3-aesteve@redhat.com>
On Tue, Jun 30, 2026 at 01:23:09PM +0200, Albert Esteve wrote:
> Add the QEMU side of the vhost-user-media device, which connects to a
> virtio-media vhost-user backend daemon implementing the V4L2 API over
> the virtio-media protocol.
>
> The virtio-media device is specified in the VirtIO specification v1.4,
> section 5.22:
> https://docs.oasis-open.org/virtio/virtio/v1.4/cs01/virtio-v1.4-cs01.html
>
> Tested with the rust-vmm vhost-device-media backend [1]:
>
> cargo run -- -s /path/to/media.sock -d /dev/video0 --backend v4l2-proxy
>
> Example invocation:
>
> qemu-system-x86_64 \
> -chardev socket,path=/tmp/media.sock,id=media \
> -device vhost-user-media-pci,chardev=media,id=media
>
> [1] https://github.com/rust-vmm/vhost-device/pull/944
>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
> ---
> hw/display/Kconfig | 5 +
> hw/display/meson.build | 3 +
> hw/display/vhost-user-media-pci.c | 77 ++++++
> hw/display/vhost-user-media.c | 393 +++++++++++++++++++++++++++
> hw/virtio/virtio.c | 3 +-
> include/hw/virtio/vhost-user-media.h | 47 ++++
> 6 files changed, 527 insertions(+), 1 deletion(-)
> create mode 100644 hw/display/vhost-user-media-pci.c
> create mode 100644 hw/display/vhost-user-media.c
> create mode 100644 include/hw/virtio/vhost-user-media.h
>
> diff --git a/hw/display/Kconfig b/hw/display/Kconfig
> index b3593fe981..060274b1e6 100644
> --- a/hw/display/Kconfig
> +++ b/hw/display/Kconfig
> @@ -120,6 +120,11 @@ config VHOST_USER_VGA
> default y
> depends on VIRTIO_VGA && VHOST_USER_GPU
>
> +config VHOST_USER_MEDIA
> + bool
> + default y
> + depends on VIRTIO && VHOST_USER
> +
> config DPCD
> bool
> select AUX
> diff --git a/hw/display/meson.build b/hw/display/meson.build
> index ffecedbf70..214c047df6 100644
> --- a/hw/display/meson.build
> +++ b/hw/display/meson.build
> @@ -37,6 +37,9 @@ system_ss.add(when: 'CONFIG_NEXTCUBE', if_true: files('next-fb.c'))
> system_ss.add(when: 'CONFIG_VGA', if_true: files('vga.c'))
> system_ss.add(when: 'CONFIG_VIRTIO', if_true: files('virtio-dmabuf.c'))
> system_ss.add(when: 'CONFIG_DM163', if_true: files('dm163.c'))
> +system_ss.add(when: 'CONFIG_VHOST_USER_MEDIA', if_true: files('vhost-user-media.c'))
> +system_ss.add(when: ['CONFIG_VHOST_USER_MEDIA', 'CONFIG_VIRTIO_PCI' ],
> + if_true: files('vhost-user-media-pci.c'))
>
> stub_ss.add([files('acpi-vga-stub.c'), pixman])
> if (config_all_devices.has_key('CONFIG_VGA_CIRRUS') or
> diff --git a/hw/display/vhost-user-media-pci.c b/hw/display/vhost-user-media-pci.c
> new file mode 100644
> index 0000000000..ad9e3900a4
> --- /dev/null
> +++ b/hw/display/vhost-user-media-pci.c
> @@ -0,0 +1,77 @@
> +/*
> + * Vhost-user MEDIA virtio device PCI glue
> + *
> + * Copyright Red Hat, Inc. 2024
Have you really been hanging on to this new code for 2 years
before posting ? Should this be 2026 ?
> + * Authors: Albert Esteve <aesteve@redhat.com>
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> diff --git a/hw/display/vhost-user-media.c b/hw/display/vhost-user-media.c
> new file mode 100644
> index 0000000000..5c627437e7
> --- /dev/null
> +++ b/hw/display/vhost-user-media.c
> @@ -0,0 +1,393 @@
> +/*
> + * Vhost-user Media device
> + *
> + * Copyright Red Hat, Inc. 2024
Same Q
> + *
> + * This is the boilerplate for instantiating a vhost-user device
> + * implementing a virtio-media device.
> + *
> + * Authors:
> + * Albert Esteve <aesteve@redhat.com>
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> diff --git a/include/hw/virtio/vhost-user-media.h b/include/hw/virtio/vhost-user-media.h
> new file mode 100644
> index 0000000000..30bdef8ce1
> --- /dev/null
> +++ b/include/hw/virtio/vhost-user-media.h
> @@ -0,0 +1,47 @@
> +/*
> + * vhost-user-media virtio device
> + *
> + * Copyright Red Hat, Inc. 2024
Again
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
next prev parent reply other threads:[~2026-06-30 11:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 11:23 [PATCH 0/3] hw/display: add vhost-user-media device Albert Esteve
2026-06-30 11:23 ` [PATCH 1/3] virtio_ids: Add ID for virtio media Albert Esteve
2026-06-30 11:23 ` [PATCH 2/3] hw/display: add vhost-user-media device Albert Esteve
2026-06-30 11:27 ` Daniel P. Berrangé [this message]
2026-06-30 11:37 ` Albert Esteve
2026-06-30 11:23 ` [PATCH 3/3] hw/display/vhost-user-media: add shared memory cache BAR Albert Esteve
2026-07-15 15:40 ` [PATCH 0/3] hw/display: add vhost-user-media device Dorinda Bassey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=akOoPD_P51HDn-Jo@redhat.com \
--to=berrange@redhat.com \
--cc=aesteve@redhat.com \
--cc=cohuck@redhat.com \
--cc=manos.pitsidianakis@linaro.org \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.