summaryrefslogtreecommitdiff
path: root/src/backend.rs
AgeCommit message (Collapse)Author
2021-03-11use sys_util and tempfile from crosvmDylan Reid
Adjust dependencies to use the crosvm-local crates. The tempfile interface is subtly different use the crosvm implementation to avoid a dependency on `rand`. Using a temporary directory avoids any chance of name collision with using rand to generate a string for a socket name. Some of the ScmSocket interfaces have changed and needed updating on both ends. BUG=b:181227406 TEST=cargo test Change-Id: Idee69f0c561642954ac1fa05c2951949e3b74fb5 Cq-Depend: chromium:2740533 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/rust-vmm/vhost/+/2717529 Tested-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org> Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
2021-03-01Upgrade to rust 2018 editionLiu Jiang
Upgrade Cargo.toml to rust edition 2018. Also introduce a helper feature flag "vhost-user" to simplify code. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-03-01Introduce VhostBackendMut traitLiu Jiang
Originally the VhostBackend trait is designed to take a mutable self, which causes a common usage pattern Arc<RwLock<T: VhostBackend>>. This pattern may enforce serialization among multiple threads. So rename the original VhostBackend as VhostBackendMut, and introduce a new VhostBackend trait with interior mutability to improve performance by removing the serialization. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-12-14vhost-kern: treat addrs in VringConfigData as HVALiu Jiang
The ring addresses in VringConfigData are host virtual addresses, and the kernel vhost drivers also expect those addresses as HVA. So it's wrong to validate/translate those addresses as GPA. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-09-04Add traits to support vhost backend devicesLiu Jiang
These interfaces are derived from the firecracker and crosvm projects. They may be extended when enable support of vhost-user protocol. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>