crosvm/devices
Alexandre Courbot ca6562849b virtio: vhost: user: box all VhostUserBackend
Using generic code for the whole vhost-user processing loop results in
the same code being instantiated per-device, which turns out to be quite
a bit of code just to avoid a few virtual calls on the VhostUserBackend
interface. Let's make DeviceRequestHandler work with boxed
VhostUserBackend trait objects instead and avoid generating that much
code.

With this patch, the size of the crosvm binary obtained using

    $ cargo build --profile chromeos && strip target/chromeos/crosvm && ls -l target/chromeos/crosvm

Goes from 6577240 to 6249560 bytes, i.e. a reduction of 320KB, of ~5% of
the binary size.

BUG=b:217480043
TEST=vhost-user console device works.

Change-Id: I1cc48404b0eb72a38aeff48bf6731d858cae9349
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3702779
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-06-15 16:50:12 +00:00
..
src virtio: vhost: user: box all VhostUserBackend 2022-06-15 16:50:12 +00:00
Cargo.toml crosvm: move run command to argh 2022-06-13 23:55:20 +00:00