mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
pci: Add error propagation to PCI BAR reprogramming
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
3e819ac797
commit
d6c68e4738
+8
-4
@@ -197,13 +197,15 @@ impl PciConfigIo {
|
||||
|
||||
// Reprogram the BAR if needed
|
||||
if let Some(params) = bar_reprog_params {
|
||||
pci_bus.device_reloc.upgrade().unwrap().move_bar(
|
||||
if let Err(e) = pci_bus.device_reloc.upgrade().unwrap().move_bar(
|
||||
params.old_base,
|
||||
params.new_base,
|
||||
params.len,
|
||||
device.deref_mut(),
|
||||
params.region_type,
|
||||
);
|
||||
) {
|
||||
error!("Failed moving device BAR: {}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -313,13 +315,15 @@ impl PciConfigMmio {
|
||||
|
||||
// Reprogram the BAR if needed
|
||||
if let Some(params) = bar_reprog_params {
|
||||
pci_bus.device_reloc.upgrade().unwrap().move_bar(
|
||||
if let Err(e) = pci_bus.device_reloc.upgrade().unwrap().move_bar(
|
||||
params.old_base,
|
||||
params.new_base,
|
||||
params.len,
|
||||
device.deref_mut(),
|
||||
params.region_type,
|
||||
);
|
||||
) {
|
||||
error!("Failed moving device BAR: {}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user