diff --git a/vm/devices/storage/disk_nvme/nvme_driver/src/driver.rs b/vm/devices/storage/disk_nvme/nvme_driver/src/driver.rs index ffc79bce8..e3bdf29b7 100644 --- a/vm/devices/storage/disk_nvme/nvme_driver/src/driver.rs +++ b/vm/devices/storage/disk_nvme/nvme_driver/src/driver.rs @@ -98,6 +98,12 @@ pub enum RestoreError { InvalidData, } +#[derive(Debug, Error)] +pub enum IOError { + #[error("no more io queues available")] + NoMoreIoQueues, +} + #[derive(Inspect)] struct IoQueue { queue: QueuePair, @@ -797,12 +803,23 @@ impl DriverWorkerTask { .find_map(|(i, issuer)| issuer.get().map(|issuer| (i, issuer))) .unwrap(); - tracing::error!( - cpu, - fallback_cpu, - error = err.as_ref() as &dyn std::error::Error, - "failed to create io queue, falling back" - ); + // Error due to running out of IO queues as a result of + // lack of hardware resources should be logged as INFO + if err.downcast_ref::().is_some() { + tracing::info!( + cpu, + fallback_cpu, + error = err.as_ref() as &dyn std::error::Error, + "failed to create io queue, falling back" + ); + } else { + tracing::error!( + cpu, + fallback_cpu, + error = err.as_ref() as &dyn std::error::Error, + "failed to create io queue, falling back" + ); + } fallback.clone() } }; @@ -819,7 +836,7 @@ impl DriverWorkerTask { cpu: u32, ) -> anyhow::Result { if self.io.len() >= state.max_io_queues as usize { - anyhow::bail!("no more io queues available"); + anyhow::bail!(IOError::NoMoreIoQueues); } let qid = self.io.len() as u16 + 1;