vhost_user_backend: move protocol_features to the backend

Extend VhostUserBackend trait with protocol_features(), so device
backend implementations can freely define which protocol features they
want to support.

Signed-off-by: Sergio Lopez <slp@redhat.com>
This commit is contained in:
Sergio Lopez
2019-10-23 16:24:07 +02:00
committed by Rob Bradford
parent 85e936d4bd
commit 08bebaae4f
2 changed files with 8 additions and 1 deletions

View File

@@ -433,6 +433,10 @@ impl VhostUserBackend for VhostUserNetBackend {
| VhostUserVirtioFeatures::PROTOCOL_FEATURES.bits()
}
fn protocol_features(&self) -> VhostUserProtocolFeatures {
VhostUserProtocolFeatures::all()
}
fn update_memory(&mut self, mem: GuestMemoryMmap) -> VhostUserBackendResult<()> {
self.mem = Some(mem);
Ok(())