mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
irq: Fix pin based interrupt for virtio-pci
When the KVM capability KVM_CAP_SIGNAL_MSI is not present, the VMM falls back from MSI-X onto pin based interrupts. Unfortunately, this was not working as expected because the VirtioPciDevice object was always creating an MSI-X capability structure in the PCI configuration space. This was causing the guest drivers to expect MSI-X interrupts instead of the pin based generated ones. This patch takes care of avoiding the creation of a dedicated MSI-X capability structure when MSI is not supported by KVM. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
4be3dfeb37
commit
24dbe7003a
+4
-3
@@ -429,9 +429,10 @@ impl DeviceManager {
|
||||
mmio_bus: &mut devices::Bus,
|
||||
msi_capable: bool,
|
||||
) -> DeviceManagerResult<()> {
|
||||
let mut virtio_pci_device =
|
||||
VirtioPciDevice::new(memory, virtio_device, DEFAULT_MSIX_VEC_NUM)
|
||||
.map_err(DeviceManagerError::VirtioDevice)?;
|
||||
let msix_num = if msi_capable { DEFAULT_MSIX_VEC_NUM } else { 0 };
|
||||
|
||||
let mut virtio_pci_device = VirtioPciDevice::new(memory, virtio_device, msix_num)
|
||||
.map_err(DeviceManagerError::VirtioDevice)?;
|
||||
|
||||
let bars = virtio_pci_device
|
||||
.allocate_bars(allocator)
|
||||
|
||||
Reference in New Issue
Block a user