mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 05:03:05 +00:00
vmm_host: remove default implementation of protocol()
Having a default protocol implementation is dangerous, as implementors can just ignore this method and return an erroneous type. BUG=None TEST=cargo build Change-Id: Iee7dbcf563be1e5b15903b0fd7bdfb7ff5823545 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3565619 Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Noah Gold <nkgold@google.com> Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
This commit is contained in:
parent
89f97d8178
commit
f9eb7f26ea
2 changed files with 5 additions and 3 deletions
4
third_party/vmm_vhost/src/dummy_slave.rs
vendored
4
third_party/vmm_vhost/src/dummy_slave.rs
vendored
|
@ -38,6 +38,10 @@ impl DummySlaveReqHandler {
|
|||
}
|
||||
|
||||
impl VhostUserSlaveReqHandlerMut for DummySlaveReqHandler {
|
||||
fn protocol(&self) -> Protocol {
|
||||
Protocol::Regular
|
||||
}
|
||||
|
||||
fn set_owner(&mut self) -> Result<()> {
|
||||
if self.owned {
|
||||
return Err(Error::InvalidOperation);
|
||||
|
|
|
@ -90,9 +90,7 @@ pub trait VhostUserSlaveReqHandler {
|
|||
#[allow(missing_docs)]
|
||||
pub trait VhostUserSlaveReqHandlerMut {
|
||||
/// Returns the type of vhost-user protocol that the handler support.
|
||||
fn protocol(&self) -> Protocol {
|
||||
Protocol::Regular
|
||||
}
|
||||
fn protocol(&self) -> Protocol;
|
||||
|
||||
fn set_owner(&mut self) -> Result<()>;
|
||||
fn reset_owner(&mut self) -> Result<()>;
|
||||
|
|
Loading…
Reference in a new issue