vmsilo fork of vhost rust libraries
Find a file
Alyssa Ross 14db3cd165 vhost_user: fix replies without GET_PROTOCOL_FEATURES
I observed hangs in the following situation when using Cloud
Hypervisor with virtiofsd:

1. Start virtiofsd
2. Start Cloud Hypervisor instance 1, connected to virtiofsd.
3. Start Cloud Hypervisor instance 2, waiting for migration.
4. Migrate VM from Cloud Hypervisor instance 1 to 2.
5. Start virtiofsd again.

The hangs happened because Cloud Hypervisor remembered, as part of the
migration data, which vhost-user protocol features the backend for its
fs device supported.  Instance 2 therefore never sent
GET_PROTOCOL_FEATURES to the second invocation of virtiofsd.  This
should work, but it didn't, because update_reply_ack_flag() checked
whether self.protocol_features contained GET_PROTOCOL_FEATURES, but
self.protocol_features is only filled in when GET_PROTOCOL_FEATURES is
called.  As a result, Cloud Hypervisor expected a reply that virtiofsd
would never send.

Since REPLY_ACK is handled entirely by the vhost-user library, and not
by the backend, there's no need to ask the backend whether it supports
REPLY_ACK in the first place, so we can just drop the check for that
from update_reply_ack_flag().  We know that we always support it, so
we just need to check whether the backend has acked it.  This fixes
the hang described above.

Since we will now always reply if the backend acks the feature,
REPLY_ACK is now always included in the set of features returned by
GET_PROTOCOL_FEATURES, just like with XEN_MMAP (when enabled).

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2025-06-03 15:56:15 +02:00
.buildkite Remove gpu-socket feature 2024-10-25 10:06:09 +02:00
.cargo cargo-config: rename to config.toml 2024-10-02 13:43:29 +02:00
.github dependabot: enable update grouping 2023-11-14 15:04:11 +01:00
rust-vmm-ci@c3ef897738 build(deps): bump rust-vmm-ci from 8ae03e5 to c3ef897 2025-03-27 09:03:28 +01:00
vhost vhost_user: fix replies without GET_PROTOCOL_FEATURES 2025-06-03 15:56:15 +02:00
vhost-user-backend vhost_user: fix replies without GET_PROTOCOL_FEATURES 2025-06-03 15:56:15 +02:00
.gitignore Update .gitignore file 2021-03-01 12:50:56 +01:00
.gitmodules Switch to rust-vmm-ci for the CI 2020-09-04 17:59:53 +03:00
Cargo.toml build: bump vmm-sys-util to 0.14.0 2025-06-03 09:08:36 +02:00
CODEOWNERS Add myself as code owner 2024-03-07 09:46:49 +01:00
coverage_config_aarch64.json vhost: Adopt new backend naming 2023-09-13 13:00:10 +02:00
coverage_config_x86_64.json build(deps): bump rust-vmm-ci from 209c04e to 1150c47 2024-10-25 14:18:16 +02:00
LICENSE Initial commit 2019-04-03 14:38:29 +08:00
LICENSE-BSD-3-Clause Refine BSD-3-Clause license file 2021-11-26 21:19:40 +08:00
README.md vhost: Add README for the workspace 2022-10-11 12:28:33 +05:30

vhost

The vhost workspace hosts libraries related to the vhost and vhost-user protocols. It currently consists of the following crates:

  • vhost -> A pure rust library for vDPA, vhost and vhost-user.
  • vhost-user-backend -> It provides a framework to implement vhost-user backend services.