Return a list of vring workers

Now that multiple worker threads can be run from the backend crate, it
is important that each backend implementation can access every worker
thread.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2020-04-09 11:27:41 +02:00 committed by Samuel Ortiz
parent 0e32b1242c
commit d08282c080

View file

@ -191,8 +191,8 @@ impl<S: VhostUserBackend> VhostUserDaemon<S> {
/// Retrieve the vring worker. This is necessary to perform further
/// actions like registering and unregistering some extra event file
/// descriptors.
pub fn get_vring_worker(&self) -> Arc<VringWorker> {
self.handler.lock().unwrap().get_vring_worker()
pub fn get_vring_workers(&self) -> Vec<Arc<VringWorker>> {
self.handler.lock().unwrap().get_vring_workers()
}
}
@ -545,8 +545,8 @@ impl<S: VhostUserBackend> VhostUserHandler<S> {
})
}
fn get_vring_worker(&self) -> Arc<VringWorker> {
self.workers[0].clone()
fn get_vring_workers(&self) -> Vec<Arc<VringWorker>> {
self.workers.clone()
}
fn vmm_va_to_gpa(&self, vmm_va: u64) -> VhostUserHandlerResult<u64> {