pub fn new(
        vm: &Arc<dyn hypervisor::Vm>,
        device: VfioDevice,
        interrupt_manager: &Arc<dyn InterruptManager<GroupConfig = MsiIrqGroupConfig>>,
        mem: GuestMemoryAtomic<GuestMemoryMmap>,
    ) -> Result<Self> {
        let device = Arc::new(device);
        device.reset();

        let configuration = PciConfiguration::new(
            0,
            0,
            0,
            PciClassCode::Other,
            &PciVfioSubclass::VfioSubclass,
            None,
            PciHeaderType::Device,
            0,
            0,
            None,
        );

        let vfio_pci_configuration = VfioPciConfig::new(Arc::clone(&device));

        let mut vfio_pci_device = VfioPciDevice {
            vm: vm.clone(),
            device,
            configuration,
            vfio_pci_configuration,
            mmio_regions: Vec::new(),
            interrupt: Interrupt {
                msi: None,
                msix: None,
            },
            mem,
        };

        vfio_pci_device.parse_capabilities(interrupt_manager);

        Ok(vfio_pci_device)
    }
/// Constructs a new Vfio Pci device for the given Vfio device
Constructs a new Vfio Pci device for the given Vfio device
Constructs a new Vfio Pci device for the given Vfio device
pub fn new(
        vm: &Arc<dyn hypervisor::Vm>,
        device: VfioDevice,
        interrupt_manager: &Arc<dyn InterruptManager<GroupConfig = MsiIrqGroupConfig>>,
        mem: GuestMemoryAtomic<GuestMemoryMmap>,
    ) -> Result<Self> {
        let device = Arc::new(device);
        device.reset();
        let configuration = PciConfiguration::new(
            0,
            0,
            0,
            PciClassCode::Other,
            &PciVfioSubclass::VfioSubclass,
            None,
            PciHeaderType::Device,
            0,
            0,
            None,
        );
        let vfio_pci_configuration = VfioPciConfig::new(Arc::clone(&device));
        let mut vfio_pci_device = VfioPciDevice {
            vm: vm.clone(),
            device,
            configuration,
            vfio_pci_configuration,
            mmio_regions: Vec::new(),
            interrupt: Interrupt {
                msi: None,
                msix: None,
            },
            mem,
        };
        vfio_pci_device.parse_capabilities(interrupt_manager);
        Ok(vfio_pci_device)
    }
pub fn new ( vm : & Arc < dyn hypervisor :: Vm > , device : VfioDevice , interrupt_manager : & Arc < dyn InterruptManager < GroupConfig = MsiIrqGroupConfig > > , mem : GuestMemoryAtomic < GuestMemoryMmap > , ) -> Result < Self > { let device = Arc :: new ( device ) ; device . reset ( ) ; let configuration = PciConfiguration :: new ( 0 , 0 , 0 , PciClassCode :: Other , & PciVfioSubclass :: VfioSubclass , None , PciHeaderType :: Device , 0 , 0 , None , ) ; let vfio_pci_configuration = VfioPciConfig :: new ( Arc :: clone ( & device ) ) ; let mut vfio_pci_device = VfioPciDevice { vm : vm . clone ( ) , device , configuration , vfio_pci_configuration , mmio_regions : Vec :: new ( ) , interrupt : Interrupt { msi : None , msix : None , } , mem , } ; vfio_pci_device . parse_capabilities ( interrupt_manager ) ; Ok ( vfio_pci_device ) }
Constructs a new Vfio Pci device for the given Vfio device
Constructs a new Vfio Pci device for the given Vfio device
vm
&Arc<dyn hypervisor::Vm>
device
VfioDevice
interrupt_manager
&Arc<dyn InterruptManager<GroupConfig = MsiIrqGroupConfig>>
mem
GuestMemoryAtomic<GuestMemoryMmap>
vm
&Arc<dyn hypervisor::Vm>
device
VfioDevice
interrupt_manager
&Arc<dyn InterruptManager<GroupConfig = MsiIrqGroupConfig>>
mem
GuestMemoryAtomic<GuestMemoryMmap>