Commit Graph

942 Commits

Author SHA1 Message Date
dependabot[bot]
f7cbe50dd0 build(deps): bump the vhost-device group in /staging with 3 updates
Bumps the vhost-device group in /staging with 3 updates: [hashbrown](https://github.com/rust-lang/hashbrown), [proc-macro2](https://github.com/dtolnay/proc-macro2) and [serde](https://github.com/serde-rs/serde).


Updates `hashbrown` from 0.14.2 to 0.14.3
- [Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/hashbrown/compare/v0.14.2...v0.14.3)

Updates `proc-macro2` from 1.0.69 to 1.0.70
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.69...1.0.70)

Updates `serde` from 1.0.192 to 1.0.193
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.192...v1.0.193)

---
updated-dependencies:
- dependency-name: hashbrown
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: proc-macro2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: serde
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-27 10:40:38 +05:30
Stefano Garzarella
1122ba7f7f buildkite: rename custom-tests.json to staging-tests.json
Rename the file to avoid confusion and add a readme to better explain
why we want to keep it aligned with
`rust-vmm-ci/.buildkite/test_description.json`

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-11-27 06:05:35 +01:00
Erik Schilling
2143bcb44c tree-wide: continue unwinds on join failures
The error from joining a thread is a bit confusing. It is only printed
if the other thread panicked. This means, effectively, we only get here
if something called .unwrap(), .expect() or panicked in a different way.
In these cases an (ugly) error was already printend. Printing a pretty
message about the join failure does not really help a lot...

So let's just continue the unwind as suggested by the docs on the join
`Result` [1].

Before:

    thread '<unnamed>' panicked at 'Test panic', crates/gpio/src/backend.rs:146:13
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any { .. }', crates/gpio/src/backend.rs:176:23

After:

    thread '<unnamed>' panicked at 'Test panic', crates/gpio/src/backend.rs:146:13
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

[1]: https://doc.rust-lang.org/std/thread/type.Result.html

Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
2023-11-20 13:05:48 +05:30
Erik Schilling
25c6ac3362 tree-wide: use new serve convenience function
This become available with the recent vhost-user-backend [1] updates and
allows to get rid of some boilerplate code.

[1] https://github.com/rust-vmm/vhost/pull/173

Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
2023-11-20 13:05:48 +05:30
dependabot[bot]
9a6d12389f build(deps): bump the vhost-device group in /staging with 2 updates
Bumps the vhost-device group in /staging with 2 updates: [rustix](https://github.com/bytecodealliance/rustix) and [toml](https://github.com/toml-rs/toml).


Updates `rustix` from 0.38.24 to 0.38.25
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.24...v0.38.25)

Updates `toml` from 0.8.2 to 0.8.8
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.2...toml-v0.8.8)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: toml
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 10:17:48 +05:30
dependabot[bot]
7c6fd97336 build(deps): bump rust-vmm-ci from 1f5d329 to 0100de0
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `1f5d329` to `0100de0`.
- [Commits](1f5d329419...0100de0f57)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 09:59:25 +05:30
dependabot[bot]
4eabf699ac build(deps): bump the vhost-device group with 1 update
Bumps the vhost-device group with 1 update: [rustix](https://github.com/bytecodealliance/rustix).

- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.24...v0.38.25)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 09:54:53 +05:30
dependabot[bot]
2e8dc1bb47 build(deps): bump the vhost-device group in /staging with 22 updates
Bumps the vhost-device group in /staging with 22 updates:

| Package | From | To |
| --- | --- | --- |
| [alsa](https://github.com/diwic/alsa-rs) | `0.7.1` | `0.8.1` |
| [clap](https://github.com/clap-rs/clap) | `4.4.6` | `4.4.8` |
| [env_logger](https://github.com/rust-cli/env_logger) | `0.10.0` | `0.10.1` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.49` | `1.0.50` |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.8.0` | `3.8.1` |
| [num_enum](https://github.com/illicitonion/num_enum) | `0.7.0` | `0.7.1` |
| [futures-executor](https://github.com/rust-lang/futures-rs) | `0.3.28` | `0.3.29` |
| [errno](https://github.com/lambda-fairy/rust-errno) | `0.3.5` | `0.3.7` |
| [futures](https://github.com/rust-lang/futures-rs) | `0.3.28` | `0.3.29` |
| [hashbrown](https://github.com/rust-lang/hashbrown) | `0.14.1` | `0.14.2` |
| [indexmap](https://github.com/bluss/indexmap) | `2.0.2` | `2.1.0` |
| [proc-macro-crate](https://github.com/bkchr/proc-macro-crate) | `1.3.1` | `2.0.0` |
| [serde](https://github.com/serde-rs/serde) | `1.0.189` | `1.0.192` |
| [serde_spanned](https://github.com/toml-rs/toml) | `0.6.3` | `0.6.4` |
| [smallvec](https://github.com/servo/rust-smallvec) | `1.11.1` | `1.11.2` |
| [syn](https://github.com/dtolnay/syn) | `2.0.38` | `2.0.39` |
| [system-deps](https://github.com/gdesmott/system-deps) | `6.1.2` | `6.2.0` |
| [target-lexicon](https://github.com/bytecodealliance/target-lexicon) | `0.12.11` | `0.12.12` |
| [termcolor](https://github.com/BurntSushi/termcolor) | `1.3.0` | `1.4.0` |
| [toml_datetime](https://github.com/toml-rs/toml) | `0.6.3` | `0.6.5` |
| [toml_edit](https://github.com/toml-rs/toml) | `0.20.2` | `0.20.7` |
| [winnow](https://github.com/winnow-rs/winnow) | `0.5.17` | `0.5.19` |


Updates `alsa` from 0.7.1 to 0.8.1
- [Commits](https://github.com/diwic/alsa-rs/compare/v0.7.1...v0.8.1)

Updates `clap` from 4.4.6 to 4.4.8
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.6...v4.4.8)

Updates `env_logger` from 0.10.0 to 0.10.1
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/v0.10.0...v0.10.1)

Updates `thiserror` from 1.0.49 to 1.0.50
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.49...1.0.50)

Updates `tempfile` from 3.8.0 to 3.8.1
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/commits)

Updates `num_enum` from 0.7.0 to 0.7.1
- [Commits](https://github.com/illicitonion/num_enum/compare/0.7.0...0.7.1)

Updates `futures-executor` from 0.3.28 to 0.3.29
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.28...0.3.29)

Updates `errno` from 0.3.5 to 0.3.7
- [Changelog](https://github.com/lambda-fairy/rust-errno/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lambda-fairy/rust-errno/compare/v0.3.5...v0.3.7)

Updates `futures` from 0.3.28 to 0.3.29
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.28...0.3.29)

Updates `hashbrown` from 0.14.1 to 0.14.2
- [Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/hashbrown/compare/v0.14.1...v0.14.2)

Updates `indexmap` from 2.0.2 to 2.1.0
- [Changelog](https://github.com/bluss/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/bluss/indexmap/compare/2.0.2...2.1.0)

Updates `proc-macro-crate` from 1.3.1 to 2.0.0
- [Release notes](https://github.com/bkchr/proc-macro-crate/releases)
- [Commits](https://github.com/bkchr/proc-macro-crate/compare/v1.3.1...v2.0.0)

Updates `serde` from 1.0.189 to 1.0.192
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.189...v1.0.192)

Updates `serde_spanned` from 0.6.3 to 0.6.4
- [Commits](https://github.com/toml-rs/toml/compare/serde_spanned-v0.6.3...serde_spanned-v0.6.4)

Updates `smallvec` from 1.11.1 to 1.11.2
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.11.1...v1.11.2)

Updates `syn` from 2.0.38 to 2.0.39
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.38...2.0.39)

Updates `system-deps` from 6.1.2 to 6.2.0
- [Release notes](https://github.com/gdesmott/system-deps/releases)
- [Commits](https://github.com/gdesmott/system-deps/compare/system-deps@6.1.2...system-deps@6.2.0)

Updates `target-lexicon` from 0.12.11 to 0.12.12
- [Commits](https://github.com/bytecodealliance/target-lexicon/compare/v0.12.11...v0.12.12)

Updates `termcolor` from 1.3.0 to 1.4.0
- [Commits](https://github.com/BurntSushi/termcolor/compare/1.3.0...1.4.0)

Updates `toml_datetime` from 0.6.3 to 0.6.5
- [Commits](https://github.com/toml-rs/toml/compare/toml_datetime-v0.6.3...toml_datetime-v0.6.5)

Updates `toml_edit` from 0.20.2 to 0.20.7
- [Commits](https://github.com/toml-rs/toml/compare/v0.20.2...v0.20.7)

Updates `winnow` from 0.5.17 to 0.5.19
- [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md)
- [Commits](https://github.com/winnow-rs/winnow/compare/v0.5.17...v0.5.19)

---
updated-dependencies:
- dependency-name: alsa
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: vhost-device
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: env_logger
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: num_enum
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: futures-executor
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: errno
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: futures
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: hashbrown
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: indexmap
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: vhost-device
- dependency-name: proc-macro-crate
  dependency-type: indirect
  update-type: version-update:semver-major
  dependency-group: vhost-device
- dependency-name: serde
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: serde_spanned
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: smallvec
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: syn
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: system-deps
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: vhost-device
- dependency-name: target-lexicon
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: termcolor
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: vhost-device
- dependency-name: toml_datetime
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: toml_edit
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: winnow
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-16 11:26:18 +01:00
dependabot[bot]
57ecd73fad build(deps): bump the vhost-device group with 2 updates
Bumps the vhost-device group with 2 updates: [itertools](https://github.com/rust-itertools/itertools) and [rustix](https://github.com/bytecodealliance/rustix).

Updates `itertools` from 0.11.0 to 0.12.0
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.11.0...v0.12.0)

Updates `rustix` from 0.38.23 to 0.38.24
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.23...v0.38.24)

---
updated-dependencies:
- dependency-name: itertools
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: vhost-device
- dependency-name: rustix
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
...

Signed-off-by: dependabot[bot] <support@github.com>

Downgrading `cc` from v1.0.84 (yanked) to v1.0.83

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-11-16 10:57:26 +01:00
Stefano Garzarella
9a7cd7e5cd bump rustix from 0.38.22 to 0.38.23
`cargo audit` is warning us that the 0.38.22 version is yanked.
Let's update it manually (and its dependencies).

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-11-14 17:04:57 +01:00
dependabot[bot]
d4147f9b40 build(deps): bump rust-vmm-ci from cf98097 to 1f5d329
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `cf98097` to `1f5d329`.
- [Commits](cf9809721d...1f5d329419)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-14 11:29:26 +01:00
Stefano Garzarella
6c7d8a5efd dependabot: run it also for staging crates
We forgot to tell dependabot to also run in the "staging" nested
workspace. Let's enable it.

Closes #536

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-11-14 11:21:49 +01:00
dependabot[bot]
9991d2e52e build(deps): bump the vhost-device group with 14 updates
Bumps the vhost-device group with 14 updates:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.4.6` | `4.4.8` |
| [env_logger](https://github.com/rust-cli/env_logger) | `0.10.0` | `0.10.1` |
| [libc](https://github.com/rust-lang/libc) | `0.2.149` | `0.2.150` |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.8.0` | `3.8.1` |
| [num_enum](https://github.com/illicitonion/num_enum) | `0.7.0` | `0.7.1` |
| [serde_yaml](https://github.com/dtolnay/serde-yaml) | `0.9.25` | `0.9.27` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.0.83` | `1.0.84` |
| [getrandom](https://github.com/rust-random/getrandom) | `0.2.10` | `0.2.11` |
| [indexmap](https://github.com/bluss/indexmap) | `2.0.2` | `2.1.0` |
| [linux-raw-sys](https://github.com/sunfishcode/linux-raw-sys) | `0.4.10` | `0.4.11` |
| [proc-macro-crate](https://github.com/bkchr/proc-macro-crate) | `1.3.1` | `2.0.0` |
| [rustix](https://github.com/bytecodealliance/rustix) | `0.38.21` | `0.38.22` |
| [termcolor](https://github.com/BurntSushi/termcolor) | `1.3.0` | `1.4.0` |
| [winnow](https://github.com/winnow-rs/winnow) | `0.5.17` | `0.5.19` |


Updates `clap` from 4.4.6 to 4.4.8
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.6...v4.4.8)

Updates `env_logger` from 0.10.0 to 0.10.1
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/v0.10.0...v0.10.1)

Updates `libc` from 0.2.149 to 0.2.150
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.149...0.2.150)

Updates `tempfile` from 3.8.0 to 3.8.1
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/commits)

Updates `num_enum` from 0.7.0 to 0.7.1
- [Commits](https://github.com/illicitonion/num_enum/compare/0.7.0...0.7.1)

Updates `serde_yaml` from 0.9.25 to 0.9.27
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](https://github.com/dtolnay/serde-yaml/compare/0.9.25...0.9.27)

Updates `cc` from 1.0.83 to 1.0.84
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.83...1.0.84)

Updates `getrandom` from 0.2.10 to 0.2.11
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/getrandom/compare/v0.2.10...v0.2.11)

Updates `indexmap` from 2.0.2 to 2.1.0
- [Changelog](https://github.com/bluss/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/bluss/indexmap/compare/2.0.2...2.1.0)

Updates `linux-raw-sys` from 0.4.10 to 0.4.11
- [Commits](https://github.com/sunfishcode/linux-raw-sys/compare/v0.4.10...v0.4.11)

Updates `proc-macro-crate` from 1.3.1 to 2.0.0
- [Release notes](https://github.com/bkchr/proc-macro-crate/releases)
- [Commits](https://github.com/bkchr/proc-macro-crate/compare/v1.3.1...v2.0.0)

Updates `rustix` from 0.38.21 to 0.38.22
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.21...v0.38.22)

Updates `termcolor` from 1.3.0 to 1.4.0
- [Commits](https://github.com/BurntSushi/termcolor/compare/1.3.0...1.4.0)

Updates `winnow` from 0.5.17 to 0.5.19
- [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md)
- [Commits](https://github.com/winnow-rs/winnow/compare/v0.5.17...v0.5.19)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: env_logger
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: num_enum
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: serde_yaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: cc
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: getrandom
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: indexmap
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: vhost-device
- dependency-name: linux-raw-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: proc-macro-crate
  dependency-type: indirect
  update-type: version-update:semver-major
  dependency-group: vhost-device
- dependency-name: rustix
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: termcolor
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: vhost-device
- dependency-name: winnow
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-14 11:21:09 +01:00
Erik Schilling
31154ea0da Update vhost-user-backend to 0.11 series
- Features were renamed from slave -> backend
- Generics got simplified
- Some write and read functions on Volatile slice got turned into
  standalone traits: ReadVolatile, WriteVolatile
- handle_event no longer returns a bool

Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
2023-11-14 10:48:19 +02:00
Erik Schilling
1556756314 vsock: fix read/write impls of mock object
These Read/Write implementations always read/wrote to the start of the
slice. This is a bit awkward and does not become easier by the test
relying on this behaviour.
Fix this by using a pair of VecDequeue, one for the read and one for the
write buffer. This better mimics a pair of network sockets. This allows
mocking the read/writes in a bit more natural ways.

VecDeque also implements Read/Write, making our impls for those a simple
forward.

Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
2023-11-14 10:48:19 +02:00
dependabot[bot]
6dabb28122 build(deps): bump virtio-bindings from 0.2.1 to 0.2.2
Bumps [virtio-bindings](https://github.com/rust-vmm/vm-virtio) from 0.2.1 to 0.2.2.
- [Release notes](https://github.com/rust-vmm/vm-virtio/releases)
- [Commits](https://github.com/rust-vmm/vm-virtio/compare/virtio-bindings-v0.2.1...virtio-bindings-v0.2.2)

---
updated-dependencies:
- dependency-name: virtio-bindings
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-13 09:25:57 +01:00
Manos Pitsidianakis
1212df9e26 sound/pipewire: add test harness for pipewire+dbus
Add test utility to launch a temporary dbus daemon, pipewire.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-11-10 17:44:32 +02:00
Stefano Garzarella
fdf3c30e08 vsock/test: fix intermittent failures
`test_start_backend_servers_failure` is failing intermittently.
In slow systems it can happen that one thread is exiting due to
an error (in this case we expect a CidAlreadyInUse error) and
another thread is creating files (Unix socket), so sometimes
test_dir.close() fails because after deleting all the files it
finds more. So let's discard eventual errors.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-11-09 11:45:26 +02:00
Matias Ezequiel Vara Larsen
4eb461ee3f sound/test: add tests for virtio_sound.rs
This commit adds simple tests for the structures in virtio_sound.rs. The
tests are split into two tests to fix a clippy error regarding the
cognitive complexity.

Signed-off-by: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
2023-11-09 09:50:39 +02:00
Stefano Garzarella
5847489855 vsock: increase test coverage
Add more tests in vhost-device-vsock to increase the coverage.

Some of them are really simple and perhaps nonsensical (tests for
Debug, Clone, etc.), but for now we don't know how to disable this
in the tool, so let's cover these cases.

The vhost-device-vsock functions coverage increases from 70.73% to
90.45%:
    Filename             Functions  Missed Functions  Executed
    ----------------------------------------------------------
    main.rs                     51                12    76.47%
    rxops.rs                     8                 0   100.00%
    rxqueue.rs                  20                 0   100.00%
    thread_backend.rs           20                 3    85.00%
    txbuf.rs                    17                 0   100.00%
    vhu_vsock.rs                37                 1    97.30%
    vhu_vsock_thread.rs         40                 5    87.50%
    vsock_conn.rs               27                 0   100.00%
    ----------------------------------------------------------
    TOTAL                      220                21    90.45%

Closes #229

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-11-08 12:34:12 +02:00
Stefano Garzarella
197dac1c81 vsock: exit if some threads terminate with errors/panics
Now that we support multiple VMs, we launch a thread for each
VM during startup.
If one of the threads other than the first one terminates with an
error or panic, the main thread waits for the first one in the join().
For example, if we launch two VMs with the same CID, if the first
thead starts after the second one, we see the error printed and
exit, otherwise we see nothing and the main stays waiting for the
first thread.

So let's introduce a channel where the various threads can notify main
and use `std::panic::catch_unwind()` to do so even if a panic happens.

If one of the threads terminates with an error or panic, we exit
immediately.

Add also a test to check this case

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-11-08 12:34:12 +02:00
Dorinda Bassey
31212150c1 sound: Add Test for vhost-device-sound
This PR adds test for uncovered code paths

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-11-07 11:15:06 +02:00
dependabot[bot]
8e1e0a7a2a build(deps): bump toml_datetime from 0.6.3 to 0.6.5
Bumps [toml_datetime](https://github.com/toml-rs/toml) from 0.6.3 to 0.6.5.
- [Commits](https://github.com/toml-rs/toml/compare/toml_datetime-v0.6.3...toml_datetime-v0.6.5)

---
updated-dependencies:
- dependency-name: toml_datetime
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 11:49:22 +05:30
dependabot[bot]
2b0f56df64 build(deps): bump rustix from 0.38.20 to 0.38.21
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.20 to 0.38.21.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.20...v0.38.21)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 11:31:16 +05:30
dependabot[bot]
d3fa3a702e build(deps): bump rust-vmm-ci from be28ad8 to cf98097
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `be28ad8` to `cf98097`.
- [Commits](be28ad8e2c...cf9809721d)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 11:31:06 +05:30
Matias Ezequiel Vara Larsen
7a00d935f9 sound/test: add tests for device.rs
This commit adds tests in test_sound_thread_failure to test that
process_control() returns Err() in the following four conditions:
    * control request with a single descriptor
    * control request in which first descriptor is write-only
    * control request in which second descriptor is read-only
    * control request with less than three descriptors for control requests
      that require three, e.g., PcmInfo, ChmapInfo

Signed-off-by: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
2023-11-02 16:19:54 +01:00
Manos Pitsidianakis
3416215092 sound: add virtualization in Cargo.toml categories
Previous commit added categories to Cargo.toml, but the only value was
`multimedia::audio`.

Thanks @stefano-garzarella for noticing I missed this.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-11-02 10:39:25 +01:00
Manos Pitsidianakis
a127c67578 CODEOWNERS: add epilys, remove mathieupoirier
Add self to CODEOWNERS to contribute with reviewing, merging other
PRs and maintaining the vhost-device-sound crate.

Also remove Mathieu Poirier, who is unavailable for maintainer duties at
this time.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-11-02 09:29:07 +00:00
Manos Pitsidianakis
90f547e98c sound: add clippy lint checks
Add basic lints to deny unidiomatic or potentially bad code.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-11-02 10:46:49 +05:30
Manos Pitsidianakis
75ca1ee428 sound: add package.categories field to Cargo.toml
Suggested by lint https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-11-02 10:46:49 +05:30
Manos Pitsidianakis
7255036df6 sound/pipewire: prevent unsigned sub overflow
A subtraction between unsigned integers is made, which by default panics
on overflow. However, we don't really need to know the difference, only
that it is not zero or less.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-11-02 10:46:49 +05:30
Dorinda Bassey
0f1eab60ec sound/pipewire: Add Pipewire Capture
Add pipewire capture to enable capturing for pipewire backend

Co-authored-by: Dorinda Bassey <dbassey@redhat.com>
Co-authored-by: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-10-31 16:07:46 +05:30
Jeongik Cha
6d0f7f64e5 vsock: adding log for epoll_register error in send_pkt
like recv_pkt, added log for epoll_register error instead of panic
Signed-off-by: Jeongik Cha <jeongik@google.com>
2023-10-31 13:52:01 +05:30
Jeongik Cha
4b6451176d vsock: try epoll_modify before epoll_register in recv_pkt
in this context, epoll listener can be already registered via other TX
event, so let it try epoll_modify first to avoid 'silent' failure which
possibly drops packets.

Signed-off-by: Jeongik Cha <jeongik@google.com>
2023-10-31 13:52:01 +05:30
Dorinda Bassey
a2d9b2e721 sound: Improve function definition
instead of consume() fn name, use read_output() fn which
is more appropriate and in sync with the write_input() fn.

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-10-30 16:34:06 +05:30
dependabot[bot]
d09d501e1c build(deps): bump rust-vmm-ci from 0b9e2e2 to be28ad8
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `0b9e2e2` to `be28ad8`.
- [Commits](0b9e2e28ba...be28ad8e2c)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 09:57:25 +05:30
Stefano Garzarella
09e9da304c vsock: avoid circular references
We have the following circular references found by Li Zebin:
    VhostUserBackend ==> VhostUserVsockThread ==> VringEpollHandler

In addition to causing a resource leak, this causes also an error
after we merged commit 38caab2 ("vsock: Don't allow duplicate CIDs").
When the VM reboot or shutdown, the application exits with the
following error:

    [ERROR vhost_device_vsock] Could not create backend:
        CID already in use by another vsock device

This happened because we have these circular references and
VhostUserVsockThread::drop() is never invoked. So, we don't remove
the cid from the map.

Let's fix this problem by simply removing the reference to
VringEpollHandler from VhostUserVsockThread. In fact, we do not
need to keep the reference for the lifetime of VhostUserVsockThread,
as we only need to add the handlers once.

Let's also rename the fields to follow the current VhostUserDaemon
API.

Closes #438

Reported-by: Li Zebin <cutelizebin@gmail.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-10-27 16:13:37 +05:30
Manos Pitsidianakis
1921ec21d8 sound: Implement RX in ALSA backend
Add an RX code path that is similar to the existing TX code in the ALSA
backend.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-10-27 11:39:04 +01:00
Manos Pitsidianakis
d00014f5a6 sound: add Buffer::desc_len() method
Add a method to return the length of the descriptor memory region and
make `data_descriptor` field private.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-10-27 11:39:04 +01:00
Manos Pitsidianakis
31175bf66c sound: Add Direction enum
We use input/output direction values in many places, yet we lose Rust's
exhaustive static checks when matching for a stream's direction. This
commits adds a Direction enum and From/Into implementations for audio
backend respective direction types.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-10-27 16:04:31 +05:30
Stefano Garzarella
b2e3f0b1a7 Bump rust-vmm-ci manually to use rustvmm/dev:v28
This new version contains alsa and pipewire libraries to build
vhost-device-sound audio backends.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-10-26 15:07:38 +05:30
Manos Pitsidianakis
573e592037 sound: fix broken tests
Tests were not updated with changes in previous commits, so update them.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-10-25 12:53:44 +05:30
Albert Esteve
5993c1f6c1 staging: update coverage target
Signed-off-by: Albert Esteve <aesteve@redhat.com>
2023-10-24 19:09:41 +05:30
Manos Pitsidianakis
30d5cf4e10 sound: clean up and improve comments, definitions
- Add some documentation comments
- Rename TxState to IoState in preparation for RX implementation
- Fix inline rust code not being escaped properly in doc comments
- Rename some fields to make their function clearer
- Cleanup some error log messages
- Replace an old TODO comment about queue size with an explanation

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-10-24 11:08:26 +01:00
Manos Pitsidianakis
04f80fc8e9 sound: add latency_bytes field to IOMessage
The latency field specifies how long it will take until the device
finishes playing the I/O message's buffers.

Since the I/O message is dropped as soon as the last bytes are copied
over to the host's internal buffers, assume the message is dropped
almost after the host has started playing this buffer.

This solves the issue of a guest app exiting before the host has done
playing audio because it kept sending new buffers as fast as possible
without waiting (latency).

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-10-24 11:08:26 +01:00
Manos Pitsidianakis
2ba56bef25 sound/alsa: fix host hwparams calculation
The host's period and buffer sizes were not being calculated correctly.

This resulted in timing mismatches.

This commit calculates the correct sizes by taking the guest's
parameters into account.

Impossible cases when matching with stream parameters will lead to
unreachable!().

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-10-24 11:08:26 +01:00
Manos Pitsidianakis
84c58404b8 sound/alsa: fix consume() use for playback
Use of consume() method was incorrect. This commit fixes the buffer
bounds used with playback in ALSA.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-10-24 11:08:26 +01:00
Manos Pitsidianakis
c10b8e18c4 sound/alsa: stop actual playback after PCM_STOP
Queued buffers were played even after the guest issued PCM_STOP.

This commit:

- makes the ALSA worker threads respect the stopped status instead
- send a start signal to worker threads on PCM_START to handle
  pre-buffering
- reduce the time of playback callbacks holding the stream lock

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-10-24 11:08:26 +01:00
Manos Pitsidianakis
aa16ef0699 sound/pipewire: handle StreamWithIdNotFound consistently
When handling controlq messages, handle StreamWithIdNotFound the same
way on all methods:

- if we are passed a &mut ControlMessage, set it to
  VIRTIO_SND_S_BAD_MSG.
- if we are passed a stream_id, return StreamWithIdNotFound.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-10-24 11:08:26 +01:00
Manos Pitsidianakis
208a796061 sound/alsa: handle PCM state transition errors gracefully
Handle some state transition errors more gracefully by retrying ALSA
operations if possible. Also rewrite the PCM_RELEASE handler to make it
more clear.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-10-24 11:08:26 +01:00