Convert the vhost git repository into a crate, which hosts vhost crate
for now. Support for vhost-user-backend and other crates will be added
later on.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
New ioctls have been recently introduced to interact with vDPA devices.
This patch is based on Linux kernel v6.0, adding the list of missing
ioctls:
- VHOST_VDPA_GET_CONFIG_SIZE
- VHOST_VDPA_GET_VQS_COUNT
- VHOST_VDPA_GET_GROUP_NUM
- VHOST_VDPA_GET_AS_NUM
- VHOST_VDPA_GET_VRING_GROUP
- VHOST_VDPA_SET_GROUP_ASID
- VHOST_VDPA_SUSPEND
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Update libc, log, vhost, virtio-queue and vm-memory
dependencies. Also, take this opportunity to specify the dependencies
with caret versions.
Switching to a newer vhost required some small changes to accommodate
the fact that VhostUserError::InvalidOperation now requires an
argument.
Signed-off-by: Sergio Lopez <slp@redhat.com>
The spec has been converted to .rst and now generated a nicer rendered
version whenever it is updated in QEMU's master branch. Lets use it
instead.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
The InvalidOperation error type covers a wide range of error cases
which can be inscrutable when passed to the user. To help with this
we:
- add a textual reason field to the error message
- create InactiveFeature for use of un-neogitated features
- create InactiveOperation for use of un-negotiated protocol extensions
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
We can wrap up the feature checking into helpers to reduce the amount
of boilerplate code while enabling us to use a more idiomatic ?; exit
path on error.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
The virtio-queue interface is updated to take into consideration error
cases and to export a single Queue.
Signed-off-by: Andreea Florescu <fandree@amazon.com>
Since it's the guest decision to rely on polling or interrupts to be
notified about used descriptors in the used ring, we can't expect an
EventFd to be set through SET_VRING_CALL if the guest chose the polling
method.
On the other hand, we always expect an EventFd to be provided through
SET_VRING_KICK since the current way of handling new descriptors is
exclusively by receiving an event through an eventfd (no polling mode
has been implemented).
That's why a vring should be initialized based on its state and if the
EventFd related to VRING_KICK has been set.
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This release aligns its dependencies with rust-vmm's vhost
infrastructure by moving to virtio-queue v0.4.0.
Signed-off-by: Sergio Lopez <slp@redhat.com>
This release aligns its dependencies with rust-vmm's vhost
infrastructure by moving to virtio-queue v0.3.0 and relaxing the
vm-memory dependency to require ">=0.7".
Signed-off-by: Sergio Lopez <slp@redhat.com>
This allows the use of newer versions of the vm-memory crate when
combined with other dependencies.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This release contains some fixes for the CI as well as the CODEOWNERS
file. It fixes the implementation of get_iova_range() for vDPA, and
finally it implements its own version of the VhostKernBackend::valid()
method for vDPA.
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Since vDPA could be dealing with IOVAs corresponding to GVAs, it
wouldn't make sense to go through the validation of the descriptor
table address, available ring address and used ring address against
the guest memory representation we have access to.
For this reason, we override the default implementation of the valid()
method from the VhostKernBackend trait, to provide a simpler
implementation.
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
A wrong ioctl request was used in get_iova_range().
Unfortunately, there was no test, otherwise the ioctl would fail.
Let's fix this by using the right ioctl request.
We also add a test by checking the values we expect from
a vDPA-block simulator that returns [0, u64::MAX] range.
Fixes #106
Reported-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
This release implements AsRawFd for VringEpollHandler, as well as adds a
way for running the vhost-user daemon as a client.
Both of these are required by Cloud Hypervisor to rely on the
vhost-user-backend crate.
Fixes#62
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
The gatekeeper-PullAssigner was not correctly added in
the codeowners file (with its github handle). Removed it
from the file, so that the codewners are automatically
requested to review a new PR.
Since I was here, also reordered alphabetically the users.
Signed-off-by: Laura Loghin <lauralg@amazon.com>
In order to support vhost-user client mode, we introduce a new method
start_client() to VhostUserDaemon. It allows the daemon to connect to
the VMM side running as the server in this case.
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
In order to let the consumer of the crate access directly the file
descriptor related to the VringEpollHandler, we implement the AsRawFd
trait.
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Previous patch causes dramatic code coverage decrease, it actually
disclose some issue in the code coverage test. Then we add test case
to cover VhostUserHandler, it actually increases the code coverage.
Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Try to increase code coverage by adding more test code. But it actually
causes dramatic decreases in code coverage:(
Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Currently trait bound declarations is a little over complex when
defines traits or implements traits/structs. Let's simplfy it.
Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Some idea tools advises to keep all methods in the same order as trait
definition when implementation the trait for structure.
Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>