pub fn process_request<M: GuestMemory>(
        &mut self,
        mem: &M,
        request: &Request,
    ) -> result::Result<u32, ProcessReqError> {
        let (status, length) = match self.execute(mem, request) {
            Ok(length) => (VIRTIO_BLK_S_OK, length),
            Err(e) => {
                error!("failed executing block request: {}", e);
                match e {
                    Error::Read(_, bytes_to_mem) => (e.status(), bytes_to_mem),
                    _ => (e.status(), 0),
                }
            }
        };
        mem.write_obj(status, request.status_addr())?;
        // Adding +1 here for the status byte. `length` should not be u32::MAX since it is expected
        // to be a multiple of SECTOR_SIZE, but using `checked_add` here for safety.
        length.checked_add(1).ok_or(ProcessReqError::Overflow)
    }
/// Processes the `request` execution result, writes its status in memory and returns the used
/// length (i.e. the total number of bytes written into the memory buffer, including the status
/// byte).
///
/// # Arguments
/// * `mem` - A reference to the guest memory.
/// * `request` - The request to execute.
Processes the `request` execution result, writes its status in memory and returns the used
length .
Processes the ` request ` execution result writes its status in memory and returns the used length .
pub fn process_request<M: GuestMemory>(
        &mut self,
        mem: &M,
        request: &Request,
    ) -> result::Result<u32, ProcessReqError> {
        let (status, length) = match self.execute(mem, request) {
            Ok(length) => (VIRTIO_BLK_S_OK, length),
            Err(e) => {
                error!("failed executing block request: {}", e);
                match e {
                    Error::Read(_, bytes_to_mem) => (e.status(), bytes_to_mem),
                    _ => (e.status(), 0),
                }
            }
        };
        mem.write_obj(status, request.status_addr())?;
        // Adding +1 here for the status byte. `length` should not be u32::MAX since it is expected
        // to be a multiple of SECTOR_SIZE, but using `checked_add` here for safety.
        length.checked_add(1).ok_or(ProcessReqError::Overflow)
    }
pub fn process_request < M : GuestMemory > ( & mut self , mem : & M , request : & Request , ) -> result :: Result < u32 , ProcessReqError > { let ( status , length ) = match self . execute ( mem , request ) { Ok ( length ) => ( VIRTIO_BLK_S_OK , length ) , Err ( e ) => { error ! ( " " e ) ; match e { Error :: Read ( _ , bytes_to_mem ) => ( e . status ( ) , bytes_to_mem ) , _ => ( e . status ( ) , 0 ) , } } } ; mem . write_obj ( status , request . status_addr ( ) ) ? ; // Adding +1 here for the status byte. `length` should not be u32::MAX since it is expected // to be a multiple of SECTOR_SIZE, but using `checked_add` here for safety. length . checked_add ( 1 ) . ok_or ( ProcessReqError :: Overflow ) }
Processes the `request` execution result, writes its status in memory and returns the used
length (i.e.
Processes the ` request ` execution result writes its status in memory and returns the used length ( i . e .
&mut self
mem
&M
request
&Request
&mut self
mem
&M
request
&Request