Make all pcid_interface methods abort the process on errors

Effectively the only way to recover from errors in the communication
with pcid is by restarting the driver from scratch possibly after
restarting pcid. As such moving the aborts from individual drivers to
pcid_interface simplifies drivers while at the same time allowing nicer
error messages.
This commit is contained in:
bjorn3
2025-03-02 12:36:35 +01:00
parent e5af02928e
commit e7fe3183b0
23 changed files with 191 additions and 262 deletions
+2 -6
View File
@@ -191,8 +191,7 @@ impl VboxGuestInfo {
}
fn main() {
let mut pcid_handle =
PciFunctionHandle::connect_default().expect("vboxd: failed to setup channel to pcid");
let mut pcid_handle = PciFunctionHandle::connect_default();
let pci_config = pcid_handle.config();
let mut name = pci_config.func.name();
@@ -237,10 +236,7 @@ fn main() {
let mut irq_file = irq.irq_handle("vboxd");
let mut port = Pio::<u32>::new(bar0 as u16);
let address = unsafe { pcid_handle.map_bar(1) }
.expect("vboxd")
.ptr
.as_ptr();
let address = unsafe { pcid_handle.map_bar(1) }.ptr.as_ptr();
{
let vmmdev = unsafe { &mut *(address as *mut VboxVmmDev) };