diff --git a/drivers/audio/ihdad/src/main.rs b/drivers/audio/ihdad/src/main.rs index 31a2add7..a75a0a35 100755 --- a/drivers/audio/ihdad/src/main.rs +++ b/drivers/audio/ihdad/src/main.rs @@ -57,7 +57,15 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! { EventQueue::::new().expect("ihdad: Could not create event queue."); let socket = Socket::nonblock().expect("ihdad: failed to create socket"); let mut device = unsafe { - hda::IntelHDA::new(address, vend_prod).expect("ihdad: failed to allocate device") + match hda::IntelHDA::new(address, vend_prod) { + Ok(dev) => dev, + Err(e) => { + log::error!("ihdad: failed to initialize HDA device (err {}), exiting gracefully", e); + log::info!("ihdad: this is expected in virtual environments without functional HDA hardware"); + daemon.ready(); + return loop {}; + } + } }; let mut readiness_based = ReadinessBased::new(&socket, 16);