/// Update the backing file and the config space of the block device.
Update the backing file and the config space of the block device.
Update the backing file and the config space of the block device .
pub fn update_disk_image(&mut self, disk_image_path: String) -> io::Result<()> {
        let disk_properties =
            DiskProperties::new(disk_image_path, self.is_read_only(), self.cache_type())?;
        self.disk = disk_properties;
        self.config_space = self.disk.virtio_block_config_space();
        // Kick the driver to pick up the changes.
        self.interrupt_status
            .fetch_or(VIRTIO_MMIO_INT_CONFIG as usize, Ordering::SeqCst);
        if let Some(intc) = &self.intc {
            intc.lock().unwrap().set_irq(self.irq_line.unwrap());
        } else {
            self.interrupt_evt.write(1).unwrap();
        }
        Ok(())
    }
pub fn update_disk_image ( & mut self , disk_image_path : String ) -> io :: Result < ( ) > { let disk_properties = DiskProperties :: new ( disk_image_path , self . is_read_only ( ) , self . cache_type ( ) ) ? ; self . disk = disk_properties ; self . config_space = self . disk . virtio_block_config_space ( ) ; // Kick the driver to pick up the changes. self . interrupt_status . fetch_or ( VIRTIO_MMIO_INT_CONFIG as usize , Ordering :: SeqCst ) ; if let Some ( intc ) = & self . intc { intc . lock ( ) . unwrap ( ) . set_irq ( self . irq_line . unwrap ( ) ) ; } else { self . interrupt_evt . write ( 1 ) . unwrap ( ) ; } Ok ( ( ) ) }
Update the backing file and the config space of the block device.
Update the backing file and the config space of the block device .
&mut self
<not_specific>
disk_image_path
String
<not_specific>