diff --git a/vhost_user_backend/src/lib.rs b/vhost_user_backend/src/lib.rs index 716c77f08..5b9a5c6c8 100644 --- a/vhost_user_backend/src/lib.rs +++ b/vhost_user_backend/src/lib.rs @@ -85,10 +85,18 @@ pub trait VhostUserBackend: Send + Sync + 'static { ) -> result::Result; /// Get virtio device configuration. - fn get_config(&self, offset: u32, size: u32) -> Vec; + /// A default implementation is provided as we cannot expect all backends + /// to implement this function. + fn get_config(&self, offset: u32, size: u32) -> Vec { + Vec::new() + } /// Set virtio device configuration. - fn set_config(&mut self, offset: u32, buf: &[u8]) -> result::Result<(), io::Error>; + /// A default implementation is provided as we cannot expect all backends + /// to implement this function. + fn set_config(&mut self, offset: u32, buf: &[u8]) -> result::Result<(), io::Error> { + Ok(()) + } } /// This structure is the public API the backend is allowed to interact with