Commit Graph

11 Commits

Author SHA1 Message Date
Stefano Garzarella
9191a0c1de chore: remove pub visibility from exit event fields
The `exit_consumer` and `exit_notifier` fields are only used internally
by the exit_event() method implementation or by send_exit_event() in the
sound device. So, they do not need to be exposed in the public API of
backend structures.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2025-11-19 12:09:37 +02:00
dependabot[bot]
9040bcb726 build(deps): bump the rust-vmm group across 2 directories with 6 updates
Bumps the rust-vmm group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [vhost](https://github.com/rust-vmm/vhost) | `0.14.0` | `0.15.0` |
| [vhost-user-backend](https://github.com/rust-vmm/vhost) | `0.20.0` | `0.21.0` |
| [virtio-queue](https://github.com/rust-vmm/vm-virtio) | `0.16.0` | `0.17.0` |
| [vm-memory](https://github.com/rust-vmm/vm-memory) | `0.16.2` | `0.17.1` |
| [vmm-sys-util](https://github.com/rust-vmm/vmm-sys-util) | `0.14.0` | `0.15.0` |
| [virtio-vsock](https://github.com/rust-vmm/vm-virtio) | `0.10.0` | `0.11.0` |

Bumps the rust-vmm group with 5 updates in the /staging directory:

| Package | From | To |
| --- | --- | --- |
| [vhost](https://github.com/rust-vmm/vhost) | `0.14.0` | `0.15.0` |
| [vhost-user-backend](https://github.com/rust-vmm/vhost) | `0.20.0` | `0.21.0` |
| [virtio-queue](https://github.com/rust-vmm/vm-virtio) | `0.16.0` | `0.17.0` |
| [vm-memory](https://github.com/rust-vmm/vm-memory) | `0.16.2` | `0.17.1` |
| [vmm-sys-util](https://github.com/rust-vmm/vmm-sys-util) | `0.14.0` | `0.15.0` |

Updates `vhost` from 0.14.0 to 0.15.0
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Commits](https://github.com/rust-vmm/vhost/compare/vhost-v0.14.0...vhost-v0.15.0)

Updates `vhost-user-backend` from 0.20.0 to 0.21.0
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Commits](https://github.com/rust-vmm/vhost/compare/vhost-user-backend-v0.20.0...vhost-user-backend-v0.21.0)

Updates `virtio-queue` from 0.16.0 to 0.17.0
- [Release notes](https://github.com/rust-vmm/vm-virtio/releases)
- [Commits](https://github.com/rust-vmm/vm-virtio/compare/virtio-queue-v0.16.0...virtio-queue-v0.17.0)

Updates `vm-memory` from 0.16.2 to 0.17.1
- [Release notes](https://github.com/rust-vmm/vm-memory/releases)
- [Changelog](https://github.com/rust-vmm/vm-memory/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vm-memory/compare/v0.16.2...v0.17.1)

Updates `vmm-sys-util` from 0.14.0 to 0.15.0
- [Release notes](https://github.com/rust-vmm/vmm-sys-util/releases)
- [Changelog](https://github.com/rust-vmm/vmm-sys-util/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vmm-sys-util/compare/v0.14.0...v0.15.0)

Updates `virtio-vsock` from 0.10.0 to 0.11.0
- [Release notes](https://github.com/rust-vmm/vm-virtio/releases)
- [Commits](https://github.com/rust-vmm/vm-virtio/compare/virtio-vsock-v0.10.0...virtio-vsock-v0.11.0)

Updates `vhost` from 0.14.0 to 0.15.0
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Commits](https://github.com/rust-vmm/vhost/compare/vhost-v0.14.0...vhost-v0.15.0)

Updates `vhost-user-backend` from 0.20.0 to 0.21.0
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Commits](https://github.com/rust-vmm/vhost/compare/vhost-user-backend-v0.20.0...vhost-user-backend-v0.21.0)

Updates `virtio-queue` from 0.16.0 to 0.17.0
- [Release notes](https://github.com/rust-vmm/vm-virtio/releases)
- [Commits](https://github.com/rust-vmm/vm-virtio/compare/virtio-queue-v0.16.0...virtio-queue-v0.17.0)

Updates `vm-memory` from 0.16.2 to 0.17.1
- [Release notes](https://github.com/rust-vmm/vm-memory/releases)
- [Changelog](https://github.com/rust-vmm/vm-memory/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vm-memory/compare/v0.16.2...v0.17.1)

Updates `vmm-sys-util` from 0.14.0 to 0.15.0
- [Release notes](https://github.com/rust-vmm/vmm-sys-util/releases)
- [Changelog](https://github.com/rust-vmm/vmm-sys-util/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vmm-sys-util/compare/v0.14.0...v0.15.0)

Updates `vhost` from 0.14.0 to 0.15.0
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Commits](https://github.com/rust-vmm/vhost/compare/vhost-v0.14.0...vhost-v0.15.0)

Updates `vhost-user-backend` from 0.20.0 to 0.21.0
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Commits](https://github.com/rust-vmm/vhost/compare/vhost-user-backend-v0.20.0...vhost-user-backend-v0.21.0)

Updates `virtio-queue` from 0.16.0 to 0.17.0
- [Release notes](https://github.com/rust-vmm/vm-virtio/releases)
- [Commits](https://github.com/rust-vmm/vm-virtio/compare/virtio-queue-v0.16.0...virtio-queue-v0.17.0)

Updates `vm-memory` from 0.16.2 to 0.17.1
- [Release notes](https://github.com/rust-vmm/vm-memory/releases)
- [Changelog](https://github.com/rust-vmm/vm-memory/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vm-memory/compare/v0.16.2...v0.17.1)

Updates `vmm-sys-util` from 0.14.0 to 0.15.0
- [Release notes](https://github.com/rust-vmm/vmm-sys-util/releases)
- [Changelog](https://github.com/rust-vmm/vmm-sys-util/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vmm-sys-util/compare/v0.14.0...v0.15.0)

Updates `vhost` from 0.14.0 to 0.15.0
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Commits](https://github.com/rust-vmm/vhost/compare/vhost-v0.14.0...vhost-v0.15.0)

Updates `vhost-user-backend` from 0.20.0 to 0.21.0
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Commits](https://github.com/rust-vmm/vhost/compare/vhost-user-backend-v0.20.0...vhost-user-backend-v0.21.0)

Updates `virtio-queue` from 0.16.0 to 0.17.0
- [Release notes](https://github.com/rust-vmm/vm-virtio/releases)
- [Commits](https://github.com/rust-vmm/vm-virtio/compare/virtio-queue-v0.16.0...virtio-queue-v0.17.0)

Updates `vm-memory` from 0.16.2 to 0.17.1
- [Release notes](https://github.com/rust-vmm/vm-memory/releases)
- [Changelog](https://github.com/rust-vmm/vm-memory/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vm-memory/compare/v0.16.2...v0.17.1)

Updates `vmm-sys-util` from 0.14.0 to 0.15.0
- [Release notes](https://github.com/rust-vmm/vmm-sys-util/releases)
- [Changelog](https://github.com/rust-vmm/vmm-sys-util/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vmm-sys-util/compare/v0.14.0...v0.15.0)

---
updated-dependencies:
- dependency-name: vhost
  dependency-version: 0.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vhost-user-backend
  dependency-version: 0.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: virtio-queue
  dependency-version: 0.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vm-memory
  dependency-version: 0.17.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vmm-sys-util
  dependency-version: 0.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: virtio-vsock
  dependency-version: 0.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vhost
  dependency-version: 0.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vhost-user-backend
  dependency-version: 0.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: virtio-queue
  dependency-version: 0.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vm-memory
  dependency-version: 0.17.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vmm-sys-util
  dependency-version: 0.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vhost
  dependency-version: 0.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vhost-user-backend
  dependency-version: 0.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: virtio-queue
  dependency-version: 0.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vm-memory
  dependency-version: 0.17.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vmm-sys-util
  dependency-version: 0.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vhost
  dependency-version: 0.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vhost-user-backend
  dependency-version: 0.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: virtio-queue
  dependency-version: 0.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vm-memory
  dependency-version: 0.17.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
- dependency-name: vmm-sys-util
  dependency-version: 0.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-vmm
...

Signed-off-by: dependabot[bot] <support@github.com>
SG: adapted code to the new changes in vhost-user-backend and vm-memory:
  - used EventConsumer & EventNotifier instead of EventFd for exit_event
  - removed vm_memory::Error::InvalidGuestRegion
  - included vm_memory::Bytes needed for read_volatile_from
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2025-11-19 11:28:08 +02:00
Manos Pitsidianakis
6ec4e6eb29 template: split into main.rs and lib.rs
Split functionality between library crate and an executable crate that
consumes the library.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2025-10-13 12:11:37 +03:00
Manos Pitsidianakis
c0e29d0124 template: enable workspace-wide lints
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2025-08-04 12:30:43 +02:00
Manos Pitsidianakis
a548e4d529 template: run clippy --fix
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2025-07-18 10:05:07 +02:00
Manos Pitsidianakis
3e1ea87bdc template: run rustfmt
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2025-07-18 10:05:07 +02:00
Wenyu Huang
91a625603f chore: bump virtio-queue and some related dependencies
virtio-queue v0.15 introduces a new Descriptor API supporting both
split and packed virtqueue.
Update our dependencies and code to work with the new version
of the crate, including updating vhost-user-backend and virtio-vsock.

Updates `vhost-user-backend` from 0.18.0 to 0.19.0
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Commits](rust-vmm/vhost@vhost-user-backend-v0.18.0...vhost-user-backend-v0.19.0)

Updates `virtio-queue` from 0.14.0 to 0.15.0
- [Release notes](https://github.com/rust-vmm/vm-virtio/releases)
- [Commits](rust-vmm/vm-virtio@virtio-queue-v0.14.0...virtio-queue-v0.15.0)

Updates `virtio-vsock` from 0.8.0 to 0.9.0
- [Release notes](https://github.com/rust-vmm/vm-virtio/releases)
- [Commits](rust-vmm/vm-virtio@virtio-vsock-v0.8.0...virtio-vsock-v0.9.0)

Signed-off-by: Wenyu Huang <huangwenyuu@outlook.com>
2025-06-23 21:36:11 +02:00
Ruoqing He
d43fd79bb7 clippy: Fix clippy::precedence
Fix `clippy::precedence` warnings reported by clippy 0.1.85 (4d91de4e48
2025-02-17).

```console
error: operator precedence can trip the unwary
   --> vhost-device-template/src/vhu_foo.rs:152:9
    |
152 | /         1 << VIRTIO_F_VERSION_1
153 | |             | 1 << VIRTIO_F_NOTIFY_ON_EMPTY
154 | |             | 1 << VIRTIO_RING_F_INDIRECT_DESC
155 | |             | 1 << VIRTIO_RING_F_EVENT_IDX
    | |__________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
    = note: `-D clippy::precedence` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::precedence)]`
help: consider parenthesizing your expression
    |
152 ~         1 << VIRTIO_F_VERSION_1
153 +             | 1 << VIRTIO_F_NOTIFY_ON_EMPTY
154 +             | 1 << VIRTIO_RING_F_INDIRECT_DESC | (1 << VIRTIO_RING_F_EVENT_IDX)
    |
```

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-31 13:45:27 +02:00
Stefano Garzarella
ef98372646 chore: fix clippy warnings
The new version of clippy in the CI suggested several improvements.
Some fixed with `clippy --fix`, some by hand.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2024-09-25 10:27:44 +03:00
Manos Pitsidianakis
ea750d7daf template: use PathBuf for socket path
clap can parse a PathBuf directly from the command line arguments, and
paths are not always UTF-8. Use PathBuf instead of a String to allow for
all valid paths.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-12-04 22:12:09 +05:30
Viresh Kumar
fe1778a731 Add vhost-device-template crate
This adds a basic template crate, which will be useful for new
developers to understand how things work and layout all basic stuff they
are expected to write to make it work.

The current implementation just parses all the requests from the
virtqueue and prints the number of descriptor chains and size of each
descriptor buffer in there.

This adds basic sanity tests as well for the same, which can be run to
test the working of the crate.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2023-12-01 15:40:19 +05:30