crosvm/devices
Alexandre Courbot 6f8f396312 virtio: vhost-user: introduce VhostUserDevice trait
Most of our VhostUserBackends require an Executor to be constructed,
which interferes with our wish to jail them: we want to create the
VhostUserBackend before the child process gets forked, but the forking
process would render the Executor invalid in the child.

Work around this issue by introducing a VhostUserDevice trait which is
supposed to include all the device state without its runtime. Once the
child process is forked, the device can be converted into a
VhostUserBackend using its into_backend() method.

This new trait is illustrated using the Console device.

BUG=b:217480043
TEST=cargo build

Change-Id: Ifc7525aae39da8fdb19fcd237832213c9223a56d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3762973
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Morg <morg@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-22 04:57:58 +00:00
..
src virtio: vhost-user: introduce VhostUserDevice trait 2022-07-22 04:57:58 +00:00
Cargo.toml devices: add bus statistics 2022-07-21 15:14:50 +00:00