mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Add pci_segment option to UserDeviceConfig
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -3063,8 +3063,7 @@ impl DeviceManager {
|
||||
&mut self,
|
||||
device_cfg: &mut UserDeviceConfig,
|
||||
) -> DeviceManagerResult<(u32, String)> {
|
||||
// TODO: Fill with PCI segment ID from config when available
|
||||
let pci_segment_id = 0;
|
||||
let pci_segment_id = device_cfg.pci_segment;
|
||||
let pci_device_bdf = self.pci_segments[pci_segment_id as usize].next_device_bdf()?;
|
||||
|
||||
let legacy_interrupt_group =
|
||||
@@ -3449,7 +3448,7 @@ impl DeviceManager {
|
||||
let (device_id, device_name) = self.add_vfio_user_device(device_cfg)?;
|
||||
|
||||
// Update the PCIU bitmap
|
||||
self.pci_segments[0].pci_devices_up |= 1 << (device_id >> 3);
|
||||
self.pci_segments[device_cfg.pci_segment as usize].pci_devices_up |= 1 << (device_id >> 3);
|
||||
|
||||
Ok(PciDeviceInfo {
|
||||
id: device_name,
|
||||
|
||||
Reference in New Issue
Block a user