fn write_config(&mut self, offset: u64, data: &[u8]) -> Result<()> {
        let data_len = data.len();
        let config_slice = self.device_config.as_mut_bytes();
        let config_len = config_slice.len();
        if offset as usize + data_len > config_len {
            return Err(ErrorKind::DevConfigOverflow(offset, config_len as u64).into());
        }

        config_slice[(offset as usize)..(offset as usize + data_len)].copy_from_slice(data);

        Ok(())
    }
/// Write data to config from guest.
Write data to config from guest.
Write data to config from guest .
fn write_config(&mut self, offset: u64, data: &[u8]) -> Result<()> {
        let data_len = data.len();
        let config_slice = self.device_config.as_mut_bytes();
        let config_len = config_slice.len();
        if offset as usize + data_len > config_len {
            return Err(ErrorKind::DevConfigOverflow(offset, config_len as u64).into());
        }
        config_slice[(offset as usize)..(offset as usize + data_len)].copy_from_slice(data);
        Ok(())
    }
fn write_config ( & mut self , offset : u64 , data : & [ u8 ] ) -> Result < ( ) > { let data_len = data . len ( ) ; let config_slice = self . device_config . as_mut_bytes ( ) ; let config_len = config_slice . len ( ) ; if offset as usize + data_len > config_len { return Err ( ErrorKind :: DevConfigOverflow ( offset , config_len as u64 ) . into ( ) ) ; } config_slice [ ( offset as usize ) .. ( offset as usize + data_len ) ] . copy_from_slice ( data ) ; Ok ( ( ) ) }
Write data to config from guest.
Write data to config from guest .
&mut self
offset
u64
data
&[u8]
&mut self
offset
u64
data
&[u8]