summaryrefslogtreecommitdiff
path: root/src/vhost_kern
AgeCommit message (Collapse)Author
2021-03-16CHROMIUM: Ignore vsock test casesKeiichi Watanabe
Disable vsock test cases accessing /dev/vhost-vsock, which is unavailable in chroot. BUG=b:181227406 TEST=cargo test --all-features in chroot Change-Id: I99a80330597c7e281f73ed60aa798ec99f307e3a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/rust-vmm/vhost/+/2759311 Tested-by: Keiichi Watanabe <keiichiw@chromium.org> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
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-03Fix clippy erros and warningsKeiichi Watanabe
Make `cargo clippy --all-features --all-targets` pass. Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
2021-03-01vhost_kern/vsock: implemnt VhostVsockLiu Jiang
Refine VhostVsock trait definition, and implement it for kernel based vsock driver. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-03-01vhost_kern: add more unit test casesLiu Jiang
Add more unit test cases for vhost-kern submodule. 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: fix a typoLiu Jiang
vhost_SET_BACKEND should be VHOST_NET_SET_BACKEND. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-12-14vhost-kern: upgrade to latest vm-memory crateLiu Jiang
Use the new GuestAddressSpace trait to simplify the implementation, avoiding carrying on a lifetime parameter. 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-04Define communication messages of vhost-user specLiu Jiang
Only basic messages are defined, and the vhost-user spec is also under development. So feel free to add needed messages. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com> Signed-off-by: Daniel Prilik <daniel@prilik.com>
2020-09-04Enable support of the in-kernel vhost-vsock driverLiu Jiang
Implement vhost_kern::Vsock to control the in-kernel vhost-vsock driver. The implementation is derived from the crosvm project. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-09-04Enable support of in-kernel vhost driverLiu Jiang
The implementation is derived from the crosvm project. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-09-04Simplify the auto-generated vhost bindingLiu Jiang
The auto-generated vhost binding is small, it would be better to include it into the vhost crate instead of building another dedicated crate for it. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>