diff --git a/vm-virtio/src/lib.rs b/vm-virtio/src/lib.rs index ceed3ccdb..5956c592b 100755 --- a/vm-virtio/src/lib.rs +++ b/vm-virtio/src/lib.rs @@ -128,6 +128,7 @@ impl fmt::Display for VirtioDeviceType { const INTERRUPT_STATUS_USED_RING: u32 = 0x1; #[allow(dead_code)] const INTERRUPT_STATUS_CONFIG_CHANGED: u32 = 0x2; +const VIRTIO_MSI_NO_VECTOR: u16 = 0xffff; #[derive(Debug)] pub enum ActivateError { diff --git a/vm-virtio/src/transport/pci_device.rs b/vm-virtio/src/transport/pci_device.rs index 15f976b85..ff86fad56 100755 --- a/vm-virtio/src/transport/pci_device.rs +++ b/vm-virtio/src/transport/pci_device.rs @@ -37,6 +37,7 @@ use crate::{ Queue, VirtioDevice, VirtioDeviceType, VirtioInterrupt, VirtioInterruptType, VirtioIommuRemapping, DEVICE_ACKNOWLEDGE, DEVICE_DRIVER, DEVICE_DRIVER_OK, DEVICE_FAILED, DEVICE_FEATURES_OK, DEVICE_INIT, INTERRUPT_STATUS_CONFIG_CHANGED, INTERRUPT_STATUS_USED_RING, + VIRTIO_MSI_NO_VECTOR, }; #[allow(clippy::enum_variant_names)] @@ -510,6 +511,10 @@ impl PciDevice for VirtioPciDevice { } }; + if vector == VIRTIO_MSI_NO_VECTOR { + return Ok(()); + } + let config = &mut msix_config_clone.lock().unwrap(); let entry = &config.table_entries[vector as usize];