Commit graph

139 commits

Author SHA1 Message Date
dependabot[bot]
5dc8b56185 build(deps): update virtio-queue requirement from 0.3 to 0.4
Updates the requirements on [virtio-queue](https://github.com/rust-vmm/vm-virtio) to permit the latest version.
- [Release notes](https://github.com/rust-vmm/vm-virtio/releases)
- [Commits](https://github.com/rust-vmm/vm-virtio/compare/virtio-queue-v0.3.0...virtio-queue-v0.4.0)

---
updated-dependencies:
- dependency-name: virtio-queue
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-05 10:01:37 +02:00
Sergio Lopez
ea2e3647f5 Release v0.4.0
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>
2022-06-01 11:22:09 +02:00
Rob Bradford
14f58eda14 build: Bump virtio-queue version to 0.3
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-11 11:55:21 +02:00
Rob Bradford
12b37dcb07 build: Relax vm-memory dependency
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>
2022-05-11 11:55:21 +02:00
dependabot[bot]
7545d23e24 Update nix requirement from 0.23 to 0.24
Updates the requirements on [nix](https://github.com/nix-rust/nix) to permit the latest version.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.23.0...v0.24.1)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-26 10:59:13 +02:00
Sebastien Boeuf
9f1bd2b99e Release v0.3.0
This release includes the latest rust-vmm/vhost crate (v0.4.0).

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-25 16:45:57 +01:00
dependabot[bot]
4fde808bd8 Update vhost requirement from 0.3 to 0.4
Updates the requirements on [vhost](https://github.com/rust-vmm/vhost) to permit the latest version.
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Changelog](https://github.com/rust-vmm/vhost/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vhost/compare/v0.3.0...v0.4.0)

---
updated-dependencies:
- dependency-name: vhost
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-21 18:22:29 +08:00
Sebastien Boeuf
355a9ce13c Release v0.2.0
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>
2022-03-07 12:39:35 +01:00
dependabot[bot]
ebb6d93fe0 Update virtio-queue requirement from 0.1 to 0.2
Updates the requirements on [virtio-queue](https://github.com/rust-vmm/vm-virtio) to permit the latest version.
- [Release notes](https://github.com/rust-vmm/vm-virtio/releases)
- [Commits](https://github.com/rust-vmm/vm-virtio/compare/virtio-queue-v0.1.0...virtio-queue-v0.2.0)

---
updated-dependencies:
- dependency-name: virtio-queue
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 10:12:30 +02:00
dependabot[bot]
6e66d2c1a4 Bump rust-vmm-ci from d216a46 to 99fe2eb
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `d216a46` to `99fe2eb`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](d216a46879...99fe2eb2e0)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 10:37:02 +01:00
Sebastien Boeuf
bbc892ba45 lib: Allow the daemon to run as a client
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>
2022-02-03 17:13:29 +08:00
Sebastien Boeuf
1c4ee49a89 Implement AsRawFd for VringEpollHandler
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>
2022-02-03 00:15:43 +08:00
Sergii Glushchenko
9517235567 Fix clippy warnings and adjust test coverage
Signed-off-by: Sergii Glushchenko <gsserge@amazon.com>
2022-01-24 12:54:10 +02:00
dependabot[bot]
4204d5237d Bump rust-vmm-ci from b6858b2 to d216a46
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `b6858b2` to `d216a46`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](b6858b232d...d216a46879)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-24 12:54:10 +02:00
dependabot[bot]
8fc1a935a0 Bump rust-vmm-ci from aee82cf to b6858b2
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `aee82cf` to `b6858b2`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](aee82cf0a4...b6858b232d)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-17 16:03:13 +01:00
dependabot[bot]
c193fa966d Update nix requirement from 0.22 to 0.23
Updates the requirements on [nix](https://github.com/nix-rust/nix) to permit the latest version.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.22.0...v0.23.1)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-03 17:49:02 +08:00
Sergio Lopez
79a6c58569 Add an initial CHANGELOG.md for v0.1.0
Add an initial CHANGELOG.md using the rust-vmm template, indicating
that v0.1.0 is the first release

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-12-22 21:21:55 +08:00
Liu Jiang
48070ccb7c Add test case to cover VhostUserHandler
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>
2021-12-22 18:58:54 +08:00
Liu Jiang
4e16112122 Refine test case to increase code coverage
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>
2021-12-22 18:58:54 +08:00
Liu Jiang
72d754b9ee Simplify trait/impl bound declarations
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>
2021-12-22 18:58:54 +08:00
Liu Jiang
eb393cf3db Simple syntax only change to keep some order
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>
2021-12-22 18:58:54 +08:00
Liu Jiang
a6c815d631 Avoid unwrap() in VhostUserDaemon::start()
The SlaveListener::accept() may return Ok(None), handle this case to
avoid unexpected panic.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-12-22 18:58:54 +08:00
Liu Jiang
f805c3e1ff Use std::io::Result to reduce duplicated code.
Use std::io::Result to reduce duplicated code.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-12-22 18:58:54 +08:00
Liu Jiang
e5a5f1fe34 Refine VringStateGuard and VringStateMutGuard
Previously VringStateGuard and VringStateMutGuard are defined as enum,
which limits the extensibility of the interface. So convert them into
traits by using the High Rank Trait Bound tricky.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-12-22 18:58:54 +08:00
Sergio Lopez
264d46d4c7 Update virtio-queue to rev cc1fa35
Update virtio-queue dependency to the latest available version, rev
"cc1fa35". This one comes with a number of fixes and new features,
such as QueueGuard and support for big-endian machines.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-12-03 23:36:20 +08:00
dependabot[bot]
4047c69747 Bump rust-vmm-ci from b037be3 to aee82cf
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `b037be3` to `aee82cf`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](b037be3396...aee82cf0a4)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-08 11:11:43 +02:00
dependabot[bot]
e10a471c6a Bump rust-vmm-ci from 7931077 to b037be3
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `7931077` to `b037be3`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](7931077cdc...b037be3396)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-01 10:45:50 +02:00
Stefano Garzarella
ec8c220807 Bump virtio-queue from 6013dd9 to 66cda80
Commit 66cda80 ("Update vm-memory requirement from 0.6 to 0.7")
is required to build this crate with vm-memory v0.7

There were API changes since commit 6013dd9, so let's update
code and tests.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2021-10-29 10:29:02 +03:00
dependabot[bot]
fc1ce25e8a Update vm-memory requirement from 0.6 to 0.7
Updates the requirements on [vm-memory](https://github.com/rust-vmm/vm-memory) to permit the latest version.
- [Release notes](https://github.com/rust-vmm/vm-memory/releases)
- [Changelog](https://github.com/rust-vmm/vm-memory/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vm-memory/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: vm-memory
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-29 10:29:02 +03:00
dependabot[bot]
b8dc194926 Bump rust-vmm-ci from 8901e77 to 7931077
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `8901e77` to `7931077`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](8901e77522...7931077cdc)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 10:01:20 +03:00
Liu Jiang
6d5fccefc7 epoll: use epoll wrapper from vmm-sys-util
There's a wrapper for epoll from vmm-sys-util, so use the wrapper
instead of the epoll crate directly. It may help to ease dependency
management.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-10-15 21:55:35 +08:00
dependabot[bot]
f22c4af539 Bump rust-vmm-ci from 7f22582 to 68d4dbf
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `7f22582` to `68d4dbf`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](7f22582590...68d4dbf85c)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 10:06:07 +03:00
dependabot[bot]
bd6b53348f Bump rust-vmm-ci from f67ef4c to 7f22582
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `f67ef4c` to `7f22582`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](f67ef4c84d...7f22582590)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-28 10:49:19 +03:00
dependabot[bot]
ecfb8467b1 Bump rust-vmm-ci from 1311bfa to f67ef4c
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `1311bfa` to `f67ef4c`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](1311bfa03f...f67ef4c84d)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-24 12:44:32 +02:00
dependabot[bot]
3242b37d32 Update vmm-sys-util requirement from 0.8 to 0.9
Updates the requirements on [vmm-sys-util](https://github.com/rust-vmm/vmm-sys-util) to permit the latest version.
- [Release notes](https://github.com/rust-vmm/vmm-sys-util/releases)
- [Changelog](https://github.com/rust-vmm/vmm-sys-util/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/vmm-sys-util/compare/v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: vmm-sys-util
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-24 12:01:35 +02:00
Sergio Lopez
17131359eb Reset the Queue on GET_VRING_BASE
According to the vhost-user specs, we should start the vring upon
receiving the first kick, and stop it when we receive GET_VRING_BASE.

Strictly speaking, we should reset the underlying Queue on the first
kick, but it's actually easier to simply do that in GET_VRING_BASE and
be ready in case the guest re-initializes the vring.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-09-23 19:43:08 +08:00
Sergio Lopez
4feeb77a20 Register listeners only with both call and kick
The vhost-user protocol doesn't impose an order for the SET_VRING_KICK
and SET_VRING_CALL messages, which implies it's valid to emit the
first before the latter.

With the current code, this means that if the VMM sends SET_VRING_KICK
before SET_VRING_CALL, and the guest has already placed a request into
the vring, we may miss signaling the guest as that request may be
processed before we have an EventFd for "call".

To fix this, delay listener registration until we have an EventFd for
both call and kick, using "VringState::Queue.ready" as an indicator
that the vring has not been initialized yet.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-09-23 19:43:08 +08:00
Sergio Lopez
a577bbc868 vring: Add "get_call" method
Add a "get_call" method to obtain the current value for the call
EventFd.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-09-23 19:43:08 +08:00
Sergio Lopez
f4ee3226c0 Cargo: update vhost dependency to v0.2.0
In addition to bringing the features from the new vhost crate, this
fixes the breakage caused by rust-vmm/vmm-sys-util#135

Signed-off-by: Sergio Lopez <slp@redhat.com>
2021-09-23 19:34:47 +08:00
Andreea Florescu
a866ed1d66 update dependabot formatting
Signed-off-by: Andreea Florescu <fandree@amazon.com>
2021-09-10 17:24:49 +03:00
Liu Jiang
70f668a699 doc: refine README.md
Refine README.md, help is needed to improve documentation for
publishing.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-09-09 10:19:50 +02:00
Liu Jiang
f2e38e294a vring: do not take &mut self for VringT
Backend::handle_event() takes an argument of `vrings: &[V]` with
`V: VringT`, so methods of VringT should not take `&mut self`.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-09-09 10:19:50 +02:00
Liu Jiang
e8beb233b5 epoll: refine the way to manage event id
Refine the way to manage epoll event id and simplify interfaces:
- Change VhostUserBackend::exit_event() to return Option<EventFd>
  instead of Option<(EventFd, u16)>.
- Delete VringEpollHandler::exit_event_id.
- Add VringEpollHandler::register_event/unregister_event for internal
  use.
- Make VringEpollHandler::register_listener/unregister_listener() for
  external users only, and 'data` range [0..backend.num_queues()] is
  reserved for queues and exit event.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-09-07 16:32:34 +08:00
Liu Jiang
5998cea89f vring: add VringT::get_mut()
Add VringT::get_mut() to get exclusive reference to underlying
VringState object, so the clients could avoid repeatedly lock/unlock
when using VringMutex and VringRwLock.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-09-07 16:32:34 +08:00
Liu Jiang
e80fab8d98 vring: add generic parameter for VringT
Enhance VhostUserBackend, VhostUserBackendMut, VringEpollHandler,
VhostUserHandler and VhostUserDaemon to support generic type
`V: VringT', so clients could choose different VringT implementations.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-09-07 16:32:34 +08:00
Liu Jiang
ed929c0cbd vring: introduce trait VringT
Introduce trait VringT, and provide three implementations of it:
VringState, VringMutex, VringRwLock.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-09-07 16:32:34 +08:00
Viresh Kumar
f363fb2b53 dependabot: Allow updating dependencies
Allow crate updates on weekly basis.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-09-06 10:03:28 +02:00
Viresh Kumar
f0af5f7fc2 backend: Set rev for virtio-queue
The builds are failing since the remote branch's name is changed to
main from master. Fix it by adding the rev for virtio-queue.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-09-03 21:24:22 +08:00
dependabot[bot]
5dde7f196b Bump rust-vmm-ci from 8901e77 to 1311bfa
Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `8901e77` to `1311bfa`.
- [Release notes](https://github.com/rust-vmm/rust-vmm-ci/releases)
- [Commits](8901e77522...1311bfa03f)

---
updated-dependencies:
- dependency-name: rust-vmm-ci
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-02 08:50:08 +02:00
Laura Loghin
f57859ea3d
Merge pull request #29 from lauralt/update_ci
rust-vmm-ci update
2021-08-31 11:02:38 +03:00