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>
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>
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>
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>