Commit Graph

804 Commits

Author SHA1 Message Date
Alex Bennée
e4aefda817 gpio: document the "mock_gpio" feature
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2023-10-09 11:36:59 +01:00
Alex Bennée
28690b6e87 gpio: add some info logging to MockGpioDevice
There is not much point having a MockGpioDevice if you don't get to
see when it state changes. Currently only MockGpioDevice emits
anything bellow an error or warning so we default to the "info" level.
Any debug added in the future will need to override RUST_LOG.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2023-10-09 11:36:59 +01:00
Alex Bennée
a8ce1ec2e0 gpio: introduce "mock_gpio" let cfg drive device type
Now we have our plumbing in place we can separate the starting of the
device backend into a new function and call appropriately. As the
config is no longer parsed inside start_backend we can ensure we pass
any errors up rather than blindly unwrapping.

We can drop DeviceUnimplemented as we can't build a version where this
happens.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2023-10-09 11:36:59 +01:00
Alex Bennée
e93b79ebf0 gpio: handle simulated device configuration
Update the configuration to accept the form n:sn:n:sn. Currently any
config for simulated devices gets skipped. This introduces
GpioDeviceType to represent the two types of GPIO device we have.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2023-10-09 11:36:59 +01:00
Alex Bennée
2298cc980b gpio: give better names to MockGpioDevice pins
This will help later with info!() output.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2023-10-09 11:36:59 +01:00
Alex Bennée
e020f33842 gpio: make MockGpioDevice open take number of gpios
This gives us a bit more flexibility on creating multiple sized
MockGpioDevices.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2023-10-09 11:36:59 +01:00
Alex Bennée
344b4d5ec5 gpio: move DummyDevice and rename to MockGpioDevice
We are about to use it to simulate a device for the real binary so
lets move it out of the gpio module into its own. We also migrate the
VirtIO constants to keep the imports somewhat sane.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2023-10-09 11:36:59 +01:00
dependabot[bot]
5f3f3ec1ed build(deps): bump the vhost-device group with 3 updates
Bumps the vhost-device group with 3 updates: [libc](https://github.com/rust-lang/libc), [linux-raw-sys](https://github.com/sunfishcode/linux-raw-sys) and [proc-macro2](https://github.com/dtolnay/proc-macro2).


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

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

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

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  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-macro2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-09 10:52:26 +05:30
dependabot[bot]
cdc826ecfc build(deps): bump the vhost-device group with 22 updates
Bumps the vhost-device group with 22 updates:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.4.3` | `4.4.6` |
| [libc](https://github.com/rust-lang/libc) | `0.2.147` | `0.2.148` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.47` | `1.0.49` |
| [vmm-sys-util](https://github.com/rust-vmm/vmm-sys-util) | `0.11.1` | `0.11.2` |
| [itertools](https://github.com/rust-itertools/itertools) | `0.10.5` | `0.11.0` |
| [byteorder](https://github.com/BurntSushi/byteorder) | `1.4.3` | `1.5.0` |
| [anstyle](https://github.com/rust-cli/anstyle) | `1.0.1` | `1.0.4` |
| [anstyle-parse](https://github.com/rust-cli/anstyle) | `0.2.1` | `0.2.2` |
| [clap_lex](https://github.com/clap-rs/clap) | `0.5.0` | `0.5.1` |
| [fastrand](https://github.com/smol-rs/fastrand) | `2.0.0` | `2.0.1` |
| [hashbrown](https://github.com/rust-lang/hashbrown) | `0.14.0` | `0.14.1` |
| [indexmap](https://github.com/bluss/indexmap) | `2.0.0` | `2.0.2` |
| [linux-raw-sys](https://github.com/sunfishcode/linux-raw-sys) | `0.4.5` | `0.4.8` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.66` | `1.0.68` |
| [regex](https://github.com/rust-lang/regex) | `1.9.4` | `1.9.6` |
| [rustix](https://github.com/bytecodealliance/rustix) | `0.38.8` | `0.38.17` |
| [termcolor](https://github.com/BurntSushi/termcolor) | `1.2.0` | `1.3.0` |
| [toml_edit](https://github.com/toml-rs/toml) | `0.19.14` | `0.19.15` |
| [unicode-ident](https://github.com/dtolnay/unicode-ident) | `1.0.11` | `1.0.12` |
| [which](https://github.com/harryfei/which-rs) | `4.4.0` | `4.4.2` |
| [winapi-util](https://github.com/BurntSushi/winapi-util) | `0.1.5` | `0.1.6` |
| [winnow](https://github.com/winnow-rs/winnow) | `0.5.15` | `0.5.16` |


Updates `clap` from 4.4.3 to 4.4.6
- [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/clap_complete-v4.4.3...v4.4.6)

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

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

Updates `vmm-sys-util` from 0.11.1 to 0.11.2
- [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/commits)

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

Updates `byteorder` from 1.4.3 to 1.5.0
- [Changelog](https://github.com/BurntSushi/byteorder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/byteorder/compare/1.4.3...1.5.0)

Updates `anstyle` from 1.0.1 to 1.0.4
- [Commits](https://github.com/rust-cli/anstyle/compare/anstyle-ls-v1.0.1...v1.0.4)

Updates `anstyle-parse` from 0.2.1 to 0.2.2
- [Commits](https://github.com/rust-cli/anstyle/compare/anstyle-parse-v0.2.1...anstyle-parse-v0.2.2)

Updates `clap_lex` from 0.5.0 to 0.5.1
- [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/clap_lex-v0.5.0...clap_lex-v0.5.1)

Updates `fastrand` from 2.0.0 to 2.0.1
- [Release notes](https://github.com/smol-rs/fastrand/releases)
- [Changelog](https://github.com/smol-rs/fastrand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/fastrand/compare/v2.0.0...v2.0.1)

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

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

Updates `linux-raw-sys` from 0.4.5 to 0.4.8
- [Commits](https://github.com/sunfishcode/linux-raw-sys/compare/v0.4.5...v0.4.8)

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

Updates `regex` from 1.9.4 to 1.9.6
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.9.4...1.9.6)

Updates `rustix` from 0.38.8 to 0.38.17
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.8...v0.38.17)

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

Updates `toml_edit` from 0.19.14 to 0.19.15
- [Commits](https://github.com/toml-rs/toml/compare/v0.19.14...v0.19.15)

Updates `unicode-ident` from 1.0.11 to 1.0.12
- [Release notes](https://github.com/dtolnay/unicode-ident/releases)
- [Commits](https://github.com/dtolnay/unicode-ident/compare/1.0.11...1.0.12)

Updates `which` from 4.4.0 to 4.4.2
- [Changelog](https://github.com/harryfei/which-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/harryfei/which-rs/compare/4.4.0...4.4.2)

Updates `winapi-util` from 0.1.5 to 0.1.6
- [Commits](https://github.com/BurntSushi/winapi-util/compare/winapi-util-0.1.5...0.1.6)

Updates `winnow` from 0.5.15 to 0.5.16
- [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md)
- [Commits](https://github.com/winnow-rs/winnow/compare/v0.5.15...v0.5.16)

---
updated-dependencies:
- dependency-name: clap
  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: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: vmm-sys-util
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: itertools
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: vhost-device
- dependency-name: byteorder
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: vhost-device
- dependency-name: anstyle
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: anstyle-parse
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: clap_lex
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: fastrand
  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-patch
  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-macro2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: regex
  dependency-type: indirect
  update-type: version-update:semver-patch
  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: toml_edit
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: unicode-ident
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: which
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: vhost-device
- dependency-name: winapi-util
  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-10-06 14:20:12 +05:30
Erik Schilling
072fadaaba dependabot: enable update grouping
This should group updates into a single PR. Hopefully, that simplfies
updates.

Updates that do _actually_ require code changes, will need a separate PR
anyway, after which dependabot can be asked to rebase/recreate.

Suggested-by: Patrick Roy <roypat@amazon.co.uk>
Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
2023-10-06 12:58:11 +05:30
dependabot[bot]
a8091b8893 build(deps): bump rust-vmm-ci from 665f31f to 9751aaa
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `665f31f` to `9751aaa`.
- [Commits](665f31f4b4...9751aaa0d0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 09:03:40 +05:30
dependabot[bot]
3169f28899 build(deps): bump aho-corasick from 1.0.5 to 1.1.1
Bumps [aho-corasick](https://github.com/BurntSushi/aho-corasick) from 1.0.5 to 1.1.1.
- [Commits](https://github.com/BurntSushi/aho-corasick/compare/1.0.5...1.1.1)

---
updated-dependencies:
- dependency-name: aho-corasick
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 08:58:26 +05:30
dependabot[bot]
ce0e11c791 build(deps): bump serde from 1.0.185 to 1.0.188
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.185 to 1.0.188.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.185...v1.0.188)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 08:58:13 +05:30
dependabot[bot]
10482e1c4a build(deps): bump memchr from 2.5.0 to 2.6.4
Bumps [memchr](https://github.com/BurntSushi/memchr) from 2.5.0 to 2.6.4.
- [Commits](https://github.com/BurntSushi/memchr/compare/2.5.0...2.6.4)

---
updated-dependencies:
- dependency-name: memchr
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-02 10:29:42 +05:30
Manos Pitsidianakis
5a7759e316 Prepend vhost-device- to crate directories
Having the directory of a crate match the name of the crate (i.e. the
one defined in its Cargo.toml) is intuitive and unambiguous.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-09-26 18:57:55 +05:30
Jeongik Cha
11cf80dcc9 [vsock] remove unused feature to reduce deps
this project uses only yaml config, so remove some of
features in config to reduce deps

Signed-off-by: Jeongik Cha <jeongik@google.com>
2023-09-26 14:08:53 +05:30
Jeongik Cha
7b2632b509 [vsock] refactor VhostUserVsockThread worker
For now, VhostUserVsockThread uses thread pool executor from futures,
but it doesn't need to use thread pool executor and futures because
we just need background worker thread, and a way to let it work.

So I removed unnecessary external dependency and made the logic simpler
by using just thread and channel

Signed-off-by: Jeongik Cha <jeongik@google.com>
2023-09-26 13:26:12 +05:30
dependabot[bot]
ed5b597c70 build(deps): bump hermit-abi from 0.3.2 to 0.3.3
Bumps [hermit-abi](https://github.com/hermitcore/hermit-rs) from 0.3.2 to 0.3.3.
- [Release notes](https://github.com/hermitcore/hermit-rs/releases)
- [Commits](https://github.com/hermitcore/hermit-rs/compare/hermit-abi-0.3.2...hermit-abi-0.3.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-26 13:17:17 +05:30
dependabot[bot]
b39be694a4 build(deps): bump shlex from 1.1.0 to 1.2.0
Bumps [shlex](https://github.com/comex/rust-shlex) from 1.1.0 to 1.2.0.
- [Changelog](https://github.com/comex/rust-shlex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/comex/rust-shlex/commits)

---
updated-dependencies:
- dependency-name: shlex
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-26 13:17:09 +05:30
dependabot[bot]
9a766a28b7 build(deps): bump regex from 1.9.3 to 1.9.4
Bumps [regex](https://github.com/rust-lang/regex) from 1.9.3 to 1.9.4.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.9.3...1.9.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-26 13:16:59 +05:30
Priyansh Rathi
38caab24c5 vsock: Don't allow duplicate CIDs
Currently, while updating the `cid_map`, it is not checked if the map
already contained a key with the same CID before. So, fail to create the
vsock thread if the CID is already in use.

Signed-off-by: Priyansh Rathi <techiepriyansh@gmail.com>
2023-09-19 17:21:21 +05:30
dependabot[bot]
a3fc80b269 build(deps): bump typenum from 1.16.0 to 1.17.0
Bumps [typenum](https://github.com/paholg/typenum) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/paholg/typenum/releases)
- [Changelog](https://github.com/paholg/typenum/blob/main/CHANGELOG.md)
- [Commits](https://github.com/paholg/typenum/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: typenum
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 11:16:35 +02:00
dependabot[bot]
8d5be26c46 build(deps): bump aho-corasick from 1.0.4 to 1.0.5
Bumps [aho-corasick](https://github.com/BurntSushi/aho-corasick) from 1.0.4 to 1.0.5.
- [Commits](https://github.com/BurntSushi/aho-corasick/compare/1.0.4...1.0.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 10:56:22 +02:00
dependabot[bot]
758605aa09 build(deps): bump serde_json from 1.0.106 to 1.0.107
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.106 to 1.0.107.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.106...v1.0.107)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 10:48:28 +02:00
dependabot[bot]
51c5bc0431 build(deps): bump clap from 4.3.23 to 4.4.3
Bumps [clap](https://github.com/clap-rs/clap) from 4.3.23 to 4.4.3.
- [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.3.23...v4.4.3)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-13 17:10:17 +02:00
Erik Schilling
2681d12435 tests: adjust code coverage after tool updates
CI was updated and now claims higher code coverage. Adjusting the values
to what the CI claims now.

Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
2023-09-13 15:58:52 +01:00
Erik Schilling
313ca7c0f2 gpio: silence (valid) clippy warning for now
This is a valid issue, but resolving takes some time. Meanwhile, we do
not want to block the CI.

Issue #442 was filed to track finding a real fix.

This should be reverted once the real fix happens.

Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
2023-09-13 15:58:52 +01:00
dependabot[bot]
5f1c19d9e5 build(deps): bump rust-vmm-ci from 7c1057e to 665f31f
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `7c1057e` to `665f31f`.
- [Commits](7c1057e9bc...665f31f4b4)
2023-09-13 15:58:52 +01:00
dependabot[bot]
802d09c542 build(deps): bump serde_json from 1.0.105 to 1.0.106
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.105 to 1.0.106.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.105...v1.0.106)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-13 10:07:07 +02:00
dependabot[bot]
212d6282bb build(deps): bump pest_derive from 2.7.2 to 2.7.3
Bumps [pest_derive](https://github.com/pest-parser/pest) from 2.7.2 to 2.7.3.
- [Release notes](https://github.com/pest-parser/pest/releases)
- [Commits](https://github.com/pest-parser/pest/compare/v2.7.2...v2.7.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-13 09:55:21 +02:00
Milan Zamazal
95d8e1d846 scmi: Add a SCMI link to the top README
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-13 09:33:26 +02:00
Alex Bennée
9c05c28a3a build(deps): bump vm-memory to 0.12.2
This should hopefully stop cargo audit complaining about our old
version.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2023-09-13 09:19:18 +02:00
dependabot[bot]
5fc40c0838 build(deps): bump pest from 2.7.2 to 2.7.3
Bumps [pest](https://github.com/pest-parser/pest) from 2.7.2 to 2.7.3.
- [Release notes](https://github.com/pest-parser/pest/releases)
- [Commits](https://github.com/pest-parser/pest/compare/v2.7.2...v2.7.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-08 08:29:25 +01:00
Milan Zamazal
c0a5c39b99 scmi: Add some notes on testing to README
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
923fa4312a scmi: Add CHANGELOG.md
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
58650819ff Increase coverage score
CI complains not only when the score is too low but also when it is
too high.  Accommodate the increased average coverage caused by adding
vhost-device-scmi and its unit tests.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
07cbe73dc8 scmi: Improve output on backend configuration error
Print a properly formatted error to both the log and terminal.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
0261d315ac scmi: Improve command line processing
When a device help is requested with `-d help', the socket argument is
still required.  This patch:

- replaces `-d help' with --help-devices;
- stops requiring the socket argument in such a case;
- prints help in case of command line parsing errors.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
847b3f44a6 scmi: Add source code docstrings
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
b84bf46d68 scmi: Add scale & offset to the accelerator in the kernel
To be able to test scaling in guests running on hosts with the dummy
IIO module.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
458f168639 scmi: Add support for industrial I/O devices
Industrial I/O (IIO) devices are present in /sys/bus/iio/devices/ on
Linux.  This patch makes them accessible to the guests via the sensor
SCMI protocol.

The implementation no way covers all the possible IIO devices.  It
supports some basic stuff, other sensors can be added as needed.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
c1637e94b8 scmi: Use new_device for ScmiDevice constructors
Instead of `new', which should be reserved for direct constructors.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
789288c372 scmi: Add sensor device initialization function
Implementation accessing real sensors will need to set up the device
instance.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
cbb0449d43 scmi: Refactor unit handling
Make unit handling better SCMI compliant.  Let's distinguish between
scalar sensors and axis sensors and report the units in the
appropriate SCMI commands.  Also, let's change the unit type to u8 to
correspond to the number of unit bits in SCMI.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
58ddb26d5b scmi: Use separate modules for device implementations
For a better readability once we start adding more devices.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
ca8f181bcd scmi: Refactor device specification and creation
Making the device configuration polymorphic requires the device struct
to exist before the device parameters are checked and assigned to the
struct fields.  Which means wrapping the struct fields by Option
unnecessarily or introducing other data confusion.

Let's extract the device configuration from traits to plain functions
in order to keep the device struct's unencumbered.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
73c536df2e scmi: Provide help for devices
Writing `--device help' on the command line will list all the
available devices and their parameters.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
4014a6366f scmi: Kernel instructions and changes for IIO added
Followup patches will allow connecting vhost-user-scmi to industrial
I/O devices.  On host without IIO devices, it’s possible to use
emulated devices for testing.  This patch documents how to use them
and also provides a slightly customized IIO dummy kernel module.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
e0fdfa4c38 scmi: Refactor devices.rs for sensor code reuse
Different sensors will have similar handling.  Let’s extract generic
parts from FakeSensor implementation into a reusable code, within the
limits of Rust.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00
Milan Zamazal
3d1cc5b370 scmi: Add a command line option for defining devices
The code already contains support for creating devices that can serve
as SCMI-accessible sensors and a sample fake devices.  But to actually
use the device, the code must be modified.

This patch adds a command line option to define the devices on start.
The format of the option value is in the QEMU style:
DEVICE,PROPERTY=VALUE,…

For example:

  --device fake,name=fake1 fake,name=fake2

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
2023-09-04 16:15:33 +01:00