fn read_config(&self, offset: u64, mut data: &mut [u8]) -> Result<()> {
        let config_len = self.state.config_space.len() as u64;
        if offset >= config_len {
            return Err(ErrorKind::DevConfigOverflow(offset, config_len).into());
        }
        if let Some(end) = offset.checked_add(data.len() as u64) {
            data.write_all(
                &self.state.config_space[offset as usize..cmp::min(end, config_len) as usize],
            )?;
        }

        Ok(())
    }
/// Read data of config from guest.
Read data of config from guest.
Read data of config from guest .
fn read_config(&self, offset: u64, mut data: &mut [u8]) -> Result<()> {
        let config_len = self.state.config_space.len() as u64;
        if offset >= config_len {
            return Err(ErrorKind::DevConfigOverflow(offset, config_len).into());
        }
        if let Some(end) = offset.checked_add(data.len() as u64) {
            data.write_all(
                &self.state.config_space[offset as usize..cmp::min(end, config_len) as usize],
            )?;
        }
        Ok(())
    }
fn read_config ( & self , offset : u64 , mut data : & mut [ u8 ] ) -> Result < ( ) > { let config_len = self . state . config_space . len ( ) as u64 ; if offset >= config_len { return Err ( ErrorKind :: DevConfigOverflow ( offset , config_len ) . into ( ) ) ; } if let Some ( end ) = offset . checked_add ( data . len ( ) as u64 ) { data . write_all ( & self . state . config_space [ offset as usize .. cmp :: min ( end , config_len ) as usize ] , ) ? ; } Ok ( ( ) ) }
Read data of config from guest.
Read data of config from guest .
&self
offset
u64
data
&mut [u8]
&self
offset
u64
data
&mut [u8]