fn activate(
        &mut self,
        mem_space: Arc<AddressSpace>,
        interrupt_cb: Arc<VirtioInterrupt>,
        queues: &[Arc<Mutex<Queue>>],
        mut queue_evts: Vec<EventFd>,
    ) -> Result<()> {
        self.interrupt_cb = Some(interrupt_cb.clone());
        let (sender, receiver) = channel();
        self.sender = Some(sender);

        let mut handler = BlockIoHandler {
            queue: queues[0].clone(),
            queue_evt: queue_evts.remove(0),
            mem_space,
            disk_image: self.disk_image.clone(),
            disk_sectors: self.disk_sectors,
            direct: self.blk_cfg.direct,
            serial_num: self.blk_cfg.serial_num.clone(),
            aio: None,
            driver_features: self.state.driver_features,
            receiver,
            update_evt: self.update_evt.as_raw_fd(),
            reset_evt: self.reset_evt.as_raw_fd(),
            interrupt_cb,
            iothread: self.blk_cfg.iothread.clone(),
            leak_bucket: self.blk_cfg.iops.map(LeakBucket::new),
        };

        handler.aio = Some(handler.build_aio()?);

        EventLoop::update_event(
            EventNotifierHelper::internal_notifiers(Arc::new(Mutex::new(handler))),
            self.blk_cfg.iothread.as_ref(),
        )?;

        Ok(())
    }
/// Activate the virtio device, this function is called by vcpu thread when frontend
/// virtio driver is ready and write `DRIVER_OK` to backend.
Activate the virtio device, this function is called by vcpu thread when frontend
virtio driver is ready and write `DRIVER_OK` to backend.
Activate the virtio device this function is called by vcpu thread when frontend virtio driver is ready and write ` DRIVER_OK ` to backend .
fn activate(
        &mut self,
        mem_space: Arc<AddressSpace>,
        interrupt_cb: Arc<VirtioInterrupt>,
        queues: &[Arc<Mutex<Queue>>],
        mut queue_evts: Vec<EventFd>,
    ) -> Result<()> {
        self.interrupt_cb = Some(interrupt_cb.clone());
        let (sender, receiver) = channel();
        self.sender = Some(sender);
        let mut handler = BlockIoHandler {
            queue: queues[0].clone(),
            queue_evt: queue_evts.remove(0),
            mem_space,
            disk_image: self.disk_image.clone(),
            disk_sectors: self.disk_sectors,
            direct: self.blk_cfg.direct,
            serial_num: self.blk_cfg.serial_num.clone(),
            aio: None,
            driver_features: self.state.driver_features,
            receiver,
            update_evt: self.update_evt.as_raw_fd(),
            reset_evt: self.reset_evt.as_raw_fd(),
            interrupt_cb,
            iothread: self.blk_cfg.iothread.clone(),
            leak_bucket: self.blk_cfg.iops.map(LeakBucket::new),
        };
        handler.aio = Some(handler.build_aio()?);
        EventLoop::update_event(
            EventNotifierHelper::internal_notifiers(Arc::new(Mutex::new(handler))),
            self.blk_cfg.iothread.as_ref(),
        )?;
        Ok(())
    }
fn activate ( & mut self , mem_space : Arc < AddressSpace > , interrupt_cb : Arc < VirtioInterrupt > , queues : & [ Arc < Mutex < Queue > > ] , mut queue_evts : Vec < EventFd > , ) -> Result < ( ) > { self . interrupt_cb = Some ( interrupt_cb . clone ( ) ) ; let ( sender , receiver ) = channel ( ) ; self . sender = Some ( sender ) ; let mut handler = BlockIoHandler { queue : queues [ 0 ] . clone ( ) , queue_evt : queue_evts . remove ( 0 ) , mem_space , disk_image : self . disk_image . clone ( ) , disk_sectors : self . disk_sectors , direct : self . blk_cfg . direct , serial_num : self . blk_cfg . serial_num . clone ( ) , aio : None , driver_features : self . state . driver_features , receiver , update_evt : self . update_evt . as_raw_fd ( ) , reset_evt : self . reset_evt . as_raw_fd ( ) , interrupt_cb , iothread : self . blk_cfg . iothread . clone ( ) , leak_bucket : self . blk_cfg . iops . map ( LeakBucket :: new ) , } ; handler . aio = Some ( handler . build_aio ( ) ? ) ; EventLoop :: update_event ( EventNotifierHelper :: internal_notifiers ( Arc :: new ( Mutex :: new ( handler ) ) ) , self . blk_cfg . iothread . as_ref ( ) , ) ? ; Ok ( ( ) ) }
Activate the virtio device, this function is called by vcpu thread when frontend
virtio driver is ready and write `DRIVER_OK` to backend.
Activate the virtio device this function is called by vcpu thread when frontend virtio driver is ready and write ` DRIVER_OK ` to backend .
&mut self
mem_space
Arc<AddressSpace>
interrupt_cb
Arc<VirtioInterrupt>
queues
&[Arc<Mutex<Queue>>]
queue_evts
Vec<EventFd>
&mut self
mem_space
Arc<AddressSpace>
interrupt_cb
Arc<VirtioInterrupt>
queues
&[Arc<Mutex<Queue>>]
queue_evts
Vec<EventFd>