Commit graph

19 commits

Author SHA1 Message Date
Liu Jiang
c008d26f51 doc: enable all features for doc.rs
Generate documentation for doc.rs with all features enabled.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-12-20 16:43:35 +08:00
Wu Zongyong
45f026046b vhost_net: implement vhost_net backend
Signed-off-by: Wu Zongyong <wuzongyong@linux.alibaba.com>
2021-11-29 16:52:57 +08:00
Rob Bradford
fca9e51956 build: Relax vm-memory dependency
By relaxing the dependency to ">=0.6" this crate can be used in projects
using newer vm-memory without pulling in duplicates of the crate.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-10-25 08:59:24 +08:00
Sergio Lopez
38fae60d81 Cargo: replace wildcard with 0.5 for serial_test
crates.io does not allow publishing crates which have wildcards in
their dependencies. We had one for "serial_test", so replace the
wildcard pointing it to the current major/minor ("0.5").

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-09-23 08:57:05 +02:00
Sergio Lopez
b4d4ce7cc4 Prepare for release v0.2.0
Update version in Cargo.toml and add info about v0.2.0 to CHANGELOG.md

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-09-23 06:50:11 +02:00
Stefano Garzarella
866932e6cc vhost_kern: add VhostKernVdpa struct
Add a vhost-vdpa in-kernel implementation of VhostVdpa trait.

Tests are serialized since the device supports only a single user
at a time.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2021-09-15 15:01:53 +08:00
Stefano Garzarella
8884465b95 Add VhostVdpa trait
Add new VhostVdpa trait to handle vhost-vdpa devices and a new
vhost-vdpa building feature.

vhost-vdpa devices is based on vhost backend, for this reason
VhostVdpa trait requires VhostBackend.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2021-09-15 15:01:53 +08:00
Alyssa Ross
ccaf8c56bf vhost_user: enforce ByteValued for recv-d structs
Converting arbitrary bytes into an arbitrary Rust value is unsafe.
For example, it's unsafe to create a String that isn't valid UTF-8.
But the various internal recv* functions didn't restrict their return
types enough to enforce this invariant, making them unsafe without
being properly marked.

To fix this, we tighten up the bounds of the functions to enforce that
their return types are ByteValued, meaning that they can only be used
to create types that are safe to initialize with arbitrary data such
as might be received over a socket.

It's worth asking how these functions could have been unsafe in the
first place, since they don't contain any unsafe blocks themselves.
The answer is that the functions that recv into iovecs are also unsafe
but not correctly marked.  I'm preparing further patches to fix that
up, but it's a lot of work so I've separated out this change in the
hope of getting it in first and making the diff for the next one
smaller.

This internal tightening shouldn't result in any public API changes.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2021-08-11 22:17:42 +08:00
Liu Jiang
14d754c5c7 Fix an error in license statement
"Apache-2.0 or BSD-3-Clause" is not an valid license statement and is
rejected by cargo. So change it to "Apache-2.0 OR BSD-3-Clause".

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-08-06 10:23:50 +02:00
Liu Jiang
56ad2ae4dd Prepare for release v0.1
Rename LICENSE-BSD-Chromium as LICENSE-BSD-Google to match the
reference in source file. Also remoce LICENSE-BSD-3-Clause, all code
contributed by Alibaba is licensed under Apache 2.0.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-08-05 17:51:35 +02:00
Liu Jiang
0c607bb299 update vm-memory requirement from 0.2.0 to 0.5.0
build(deps): update vm-memory requirement from 0.2.0 to 0.5.0
Updates the requirements on
[vm-memory](https://github.com/rust-vmm/vm-memory) to permit the latest
version.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-07-29 18:37:01 +08:00
Sebastien Boeuf
a8ff939161 vhost_user: Add Inflight I/O tracking support
The inflight I/O tracking feature is useful for handling crashes and
disconnections from the backend. It allows the backend to rely on a
buffer that was shared earlier with the VMM to restore to the previous
state it was before the crash.

This feature depends on the availability of the protocol feature
VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD, and it implements both
VHOST_USER_GET_INFLIGHT_FD and VHOST_USER_SET_INFLIGHT_FD messages.

Fixes #43

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-11 13:51:37 +02:00
Liu Jiang
576694bcfb Prepare for publishing to crates.io
Prepare for publishing to crates.io,
1) update README.md
2) update Cargo.toml
3) set code owners

It should be ready for publishing now.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-03-01 12:50:56 +01:00
Liu Jiang
97421f754d Upgrade to rust 2018 edition
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-01 12:50:56 +01:00
Liu Jiang
560a28589c Define communication messages of vhost-user spec
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-04 17:59:53 +03:00
Liu Jiang
f697910ec2 Simplify the auto-generated vhost binding
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>
2020-09-04 17:59:53 +03:00
Liu Jiang
bcbbaaabb3 Add traits to support vhost backend devices
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>
2020-09-04 17:59:53 +03:00
Liu Jiang
5d61e36bda Add license files for BSD-Alibaba, BSD-Google
Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-09-04 17:59:53 +03:00
Liu Jiang
e0ee5887f7 Initial commit 2019-04-03 14:38:29 +08:00