fn activate(
        &mut self,
        mem_space: Arc<AddressSpace>,
        interrupt_cb: Arc<VirtioInterrupt>,
        queues: &[Arc<Mutex<Queue>>],
        mut queue_evts: Vec<EventFd>,
    ) -> Result<()> {
        let handler = RngHandler {
            queue: queues[0].clone(),
            queue_evt: queue_evts.remove(0),
            reset_evt: self.reset_evt.as_raw_fd(),
            interrupt_cb,
            driver_features: self.state.driver_features,
            mem_space,
            random_file: self
                .random_file
                .as_ref()
                .unwrap()
                .try_clone()
                .chain_err(|| "Failed to clone random file for virtio rng")?,
            leak_bucket: self.rng_cfg.bytes_per_sec.map(LeakBucket::new),
        };

        EventLoop::update_event(
            EventNotifierHelper::internal_notifiers(Arc::new(Mutex::new(handler))),
            None,
        )?;

        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<()> {
        let handler = RngHandler {
            queue: queues[0].clone(),
            queue_evt: queue_evts.remove(0),
            reset_evt: self.reset_evt.as_raw_fd(),
            interrupt_cb,
            driver_features: self.state.driver_features,
            mem_space,
            random_file: self
                .random_file
                .as_ref()
                .unwrap()
                .try_clone()
                .chain_err(|| "Failed to clone random file for virtio rng")?,
            leak_bucket: self.rng_cfg.bytes_per_sec.map(LeakBucket::new),
        };
        EventLoop::update_event(
            EventNotifierHelper::internal_notifiers(Arc::new(Mutex::new(handler))),
            None,
        )?;
        Ok(())
    }
fn activate ( & mut self , mem_space : Arc < AddressSpace > , interrupt_cb : Arc < VirtioInterrupt > , queues : & [ Arc < Mutex < Queue > > ] , mut queue_evts : Vec < EventFd > , ) -> Result < ( ) > { let handler = RngHandler { queue : queues [ 0 ] . clone ( ) , queue_evt : queue_evts . remove ( 0 ) , reset_evt : self . reset_evt . as_raw_fd ( ) , interrupt_cb , driver_features : self . state . driver_features , mem_space , random_file : self . random_file . as_ref ( ) . unwrap ( ) . try_clone ( ) . chain_err ( | | " " ) ? , leak_bucket : self . rng_cfg . bytes_per_sec . map ( LeakBucket :: new ) , } ; EventLoop :: update_event ( EventNotifierHelper :: internal_notifiers ( Arc :: new ( Mutex :: new ( handler ) ) ) , None , ) ? ; 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>