mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
pci: Replace BAR tuple with PciBarConfiguration
In order to make the code more consistent and easier to read, we remove the former tuple that was used to describe a BAR, replacing it with the existing structure PciBarConfiguration. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -3285,16 +3285,16 @@ impl DeviceManager {
|
||||
.map_err(DeviceManagerError::AddPciDevice)?;
|
||||
|
||||
let mut new_resources = Vec::new();
|
||||
for pci_bar in bars.iter() {
|
||||
match pci_bar.2 {
|
||||
for bar in bars {
|
||||
match bar.region_type() {
|
||||
PciBarRegionType::IoRegion => new_resources.push(Resource::PioAddressRange {
|
||||
base: pci_bar.0.raw_value() as u16,
|
||||
size: pci_bar.1 as u16,
|
||||
base: bar.addr() as u16,
|
||||
size: bar.size() as u16,
|
||||
}),
|
||||
PciBarRegionType::Memory32BitRegion | PciBarRegionType::Memory64BitRegion => {
|
||||
new_resources.push(Resource::MmioAddressRange {
|
||||
base: pci_bar.0.raw_value(),
|
||||
size: pci_bar.1 as u64,
|
||||
base: bar.addr(),
|
||||
size: bar.size() as u64,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user