diff --git a/vm-migration/src/protocol.rs b/vm-migration/src/protocol.rs index bc0d60e96..28cdc9083 100644 --- a/vm-migration/src/protocol.rs +++ b/vm-migration/src/protocol.rs @@ -52,7 +52,7 @@ use crate::bitpos_iterator::BitposIteratorExt; // The source can at any time send an "abandon request" to cancel #[repr(u16)] -#[derive(Copy, Clone, Default)] +#[derive(Debug, Copy, Clone, Default, PartialEq, Eq)] pub enum Command { #[default] Invalid, @@ -176,6 +176,10 @@ impl Response { self.status } + pub fn length(&self) -> u64 { + self.length + } + pub fn read_from(fd: &mut dyn Read) -> Result { let mut response = Response::default(); fd.read_exact(Self::as_mut_slice(&mut response))