This commit aims to allow the vhost-user-vsock to support local yaml configuration. It introduces a new parameter '--config <CONFIG>' to allow user to input a yaml configuration during startup and uses config-rs to parse it. Note that the configuration is currently made conflicted to the original input parameters. It introduces a new error -- ConfigParse inside the crates/vsock/src/vhu_vsock.rs to support runtime error handling and the new test_vsock_config_from_file() test. It includes a new README.md with a parameter specification and a config example in the Usage section. It also introduces serde_deserialize(yaml) for VsockParam to let config-rs directly pack the field specified in the array into the VsockParam as suggested in config-rs. The serde crate is added to crates/vsock/Cargo.toml correspondingly. This commit also changes the original #[clap] into #[arg] as suggested in clap-v4. Signed-off-by: Yiyang Wu <toolmanp@outlook.com> |
||
|---|---|---|
| .cargo | ||
| .github | ||
| crates | ||
| rust-vmm-ci@8627b3766b | ||
| .gitignore | ||
| .gitmodules | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CODEOWNERS | ||
| coverage_config_x86_64.json | ||
| LICENSE-APACHE | ||
| LICENSE-BSD-3-Clause | ||
| README.md | ||
vhost-device
Design
This repository hosts various 'vhost-user' device backends in their own crates. See their individual README.md files for specific information about those crates.
Here is the list of device backends that we support:
Testing and Code Coverage
Like the wider rust-vmm project we expect new features to come with comprehensive code coverage. However as a multi-binary repository there are cases where avoiding a drop in coverage can be hard and an exception to the approach is allowable. These are:
- adding a new binary target (aim at least 60% overall coverage)
- expanding the main function (a small drop is acceptable)
However any new feature added to an existing binary should not cause a drop in coverage. The general aim should be to always improve coverage.
Separation of Concerns
The binaries built by this repository can be run with any VMM which can act as a vhost-user frontend. Typically they have been tested with QEMU although the rust-vmm project does provide a vhost-user frontend crate for rust based VMMs.
While it's possible to implement all parts of the backend inside the vhost-device workspace consideration should be given to separating the VirtQueue handling and response logic to a crate in vm-virtio devices. This way a monolithic rust-vmm VMM implementation can reuse the core logic to service the virtio requests directly in the application.
Build dependency
The GPIO crate needs a local installation of libgpiod library to be available, which can be done like:
$ git clone --depth 1 --branch v2.0-rc1 https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ $ cd libgpiod $ ./autogen.sh && make
Either you can do a 'make install' now on your system, or provide path to the locally build library like this while building vhost-device crates:
$ RUSTFLAGS='-L /home//libgpiod/lib/.libs/' cargo build --release