-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The refactor looks great, just a couple of simple copy&paste typos :-)
Thanks for working on this. I must be missing something, but I can't find a way to access the underlying |
I realized this issue and have updated the patch yesterday. Now we have "VringState::get_queue()" and "VringState::get_queue_mut()" for that purpose. |
Great, thanks! I've tested this crate with virtiofsd, and was able to implement both a multi-threaded method and a single-threaded method for processing the queue, so I think this model should work for most consumers of this crate. One change that I think could be interesting, is publishing |
Done:) |
Thanks again! :-) |
Introduce trait VringT, and provide three implementations of it: VringState, VringMutex, VringRwLock. Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
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>
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>
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (again), thanks!
Add
trait VringT
and provide three implementation of it: VringState, VringMutex, VringRwLock,so clients could choose different implementation.