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>
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>
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>
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>
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>
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>
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>
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>
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>
Writing `--device help' on the command line will list all the
available devices and their parameters.
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
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>
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>
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>
This patch implements the necessary parts of the SCMI sensor
management protocol, required either by the SCMI standard or by Linux
VIRTIO SCMI drivers to function correctly. A part of this
implementation is a fake sensor device, which is useful for both unit
testing here and a testing with a real guest OS.
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
Implementation of the mandatory parts of the SCMI base protocol. This
allows the daemon to communicate with the guest SCMI VIRTIO device,
although not yet providing any useful functionality.
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
This patch adds support for a SCMI vhost-user device. It implements
the basic skeleton of the vhost-user daemon and of SCMI processing.
It doesn’t provide any real functionality yet, adding it will be the
subject of followup patches.
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
cargo complains with the following otherwise:
some crates are on edition 2021 which defaults to resolver = 2,
but virtual workspaces default to resolver = 1
Signed-off-by: Bilal Elmoussaoui <belmouss@redhat.com>
vhost-user-backend v0.10.0 introduced an issue that affects
all vhost-user backends. I easily reproduced the problem with
vhost-device-vsock: just restart the guest kernel and the
device no longer works.
vhost-user-backend v0.10.1 includes the fix [1] for that issue.
[1] https://github.com/rust-vmm/vhost/pull/180
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
The main target of this update is vm-memory to a newer stable version,
but lets update everything anyway.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>