crosvm/third_party/vmm_vhost
David Stevens 31f04e9270 vmm_vhost: fix receiving reply payloads
The existing code confuses the length of the request with the length of
the reply in recv_reply_with_payload. This makes it impossible to use
for any requests where the reply differs in size. Fix this by
determining payload size after reading the reply header.

BUG=b:201745804
TEST=compiles

Change-Id: Iec21918e45b81d299f3178e7893e146cbd4c7db7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3716343
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
2022-07-01 08:13:52 +00:00
..
.buildkite third_party/vmm_vhost: Add vmm_vhost code into /third_party/ 2021-11-10 08:42:11 +00:00
.cargo third_party/vmm_vhost: Add vmm_vhost code into /third_party/ 2021-11-10 08:42:11 +00:00
.github third_party/vmm_vhost: Add vmm_vhost code into /third_party/ 2021-11-10 08:42:11 +00:00
docs vmm_vhost: Delete vhost-kern and vhost-vsock 2021-12-01 09:45:44 +00:00
src vmm_vhost: fix receiving reply payloads 2022-07-01 08:13:52 +00:00
.gitignore third_party/vmm_vhost: Add vmm_vhost code into /third_party/ 2021-11-10 08:42:11 +00:00
.gitmodules third_party/vmm_vhost: Add vmm_vhost code into /third_party/ 2021-11-10 08:42:11 +00:00
Cargo.toml Enable vmm_vhost windows tests 2022-03-29 20:29:54 +00:00
CODEOWNERS third_party/vmm_vhost: Add vmm_vhost code into /third_party/ 2021-11-10 08:42:11 +00:00
LICENSE third_party/vmm_vhost: Add vmm_vhost code into /third_party/ 2021-11-10 08:42:11 +00:00
LICENSE-BSD-3-Clause third_party/vmm_vhost: Add vmm_vhost code into /third_party/ 2021-11-10 08:42:11 +00:00
LICENSE-BSD-Chromium third_party/vmm_vhost: Add vmm_vhost code into /third_party/ 2021-11-10 08:42:11 +00:00
README.md vmm_vhost: Delete vhost-kern and vhost-vsock 2021-12-01 09:45:44 +00:00

vHost

A pure rust library for vhost-user. This is a fork of rust-vmm/vhost.

vhost Architecture

The vhost-user protocol aims to implement vhost backend drivers in userspace, which complements the ioctl interface used to control the vhost implementation in the Linux kernel. It implements the control plane needed to establish virtqueue sharing with a user space process on the same host. It uses communication over a Unix domain socket to share file descriptors in the ancillary data of the message.

The protocol defines two sides of the communication, master and slave. Master is the application that shares its virtqueues, slave is the consumer of the virtqueues. Master and slave can be either a client (i.e. connecting) or server (listening) in the socket communication.