mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-04 19:11:11 +00:00
vmm: Use device's segment when removing a device
The segment ID has been stored in the DeviceTree. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
d33d254921
commit
49f19e061b
@ -3435,7 +3435,11 @@ impl DeviceManager {
|
||||
|
||||
let pci_device_bdf = pci_device_node
|
||||
.pci_bdf
|
||||
.ok_or(DeviceManagerError::MissingPciDevice)?;
|
||||
.ok_or(DeviceManagerError::MissingDeviceNodePciBdf)?;
|
||||
let pci_segment_id = pci_device_node
|
||||
.pci_segment_id
|
||||
.ok_or(DeviceManagerError::MissingDeviceNodePciSegmentId)?;
|
||||
|
||||
let pci_device_handle = pci_device_node
|
||||
.pci_device_handle
|
||||
.as_ref()
|
||||
@ -3462,7 +3466,7 @@ impl DeviceManager {
|
||||
}
|
||||
|
||||
// Update the PCID bitmap
|
||||
self.pci_segments[0].pci_devices_down |= 1 << (pci_device_bdf >> 3);
|
||||
self.pci_segments[pci_segment_id as usize].pci_devices_down |= 1 << (pci_device_bdf >> 3);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user