Skip to content

Conversation

@ser-io
Copy link
Member

@ser-io ser-io commented Dec 15, 2025

Port virtio media reference device simple_device as a vhost user implementation.

First iteration of simple_device/src/simple_device.rs is the same as in virtio-media upstream https://github.com/chromeos/virtio-media/blob/main/device/src/devices/simple_device.rs.

cargo run --bin simple_device  -- --socket-path /tmp/simple_device.sock
cargo run --features "media" -- --log-level=debug run --cpus 4 --mem 4096 \
  --rwdisk /path/to/debian-12.img \
  --params "root=/dev/vda1" \
  --vhost-user media,socket=/tmp/simple_device.sock \
  /path/to/bzImage

v4l2-compliance -d0 -s

Bug: 445229097

Port virtio media reference device `simple_device` as a vhost user
implementation.

First iteration of `simple_device/src/simple_device.rs` is the same as
in virtio-media upstream https://github.com/chromeos/virtio-media/blob/main/device/src/devices/simple_device.rs.

```
cargo run --bin simple_device  -- --socket-path /tmp/simple_device.sock
```

```
cargo run --features "media" -- --log-level=debug run --cpus 4 --mem 4096 \
  --rwdisk /path/to/debian-12.img \
  --params "root=/dev/vda1" \
  --vhost-user media,socket=/tmp/simple_device.sock \
  /path/to/bzImage

v4l2-compliance -d0 -s
```

Bug: 445229097
@ser-io ser-io requested review from Databean and jemoreira December 15, 2025 22:34
@jemoreira
Copy link
Member

Port virtio media reference device simple_device as a vhost user implementation.

First iteration of simple_device/src/simple_device.rs is the same as in virtio-media upstream https://github.com/chromeos/virtio-media/blob/main/device/src/devices/simple_device.rs.

Why are you copying this code here instead of depending on it? Would it be possible to contribute changes upstream and only implement the cuttlefish-specific changes here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add bazel files too

Comment on lines +1 to +4
//! Simple example virtio-media CAPTURE device with no dependency.
//!
//! This module illustrates how to write a device for virtio-media. It exposes a capture device
//! that generates a RGB pattern on the buffers queued by the guest.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original file has a license declaration, that has to be maintained if you want to copy the file.

@ser-io ser-io requested a review from adelva1984 December 18, 2025 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants