mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Calculate number of msix interrupts in VirtioPciDevice
Rather than calculate in the DeviceManager and pass it through do it in the device where it already has all the required information. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -4172,11 +4172,6 @@ impl DeviceManager {
|
||||
return Err(DeviceManagerError::MissingNode);
|
||||
}
|
||||
|
||||
// Allows support for one MSI-X vector per interrupt needed by the device.
|
||||
// It also adds 1 as we need to take into account the dedicated vector to notify
|
||||
// about a virtio config change.
|
||||
let msix_num = (virtio_device.lock().unwrap().queue_max_sizes().len() + 1) as u16;
|
||||
|
||||
// Create the AccessPlatform trait from the implementation IommuMapping.
|
||||
// This will provide address translation for any virtio device sitting
|
||||
// behind a vIOMMU.
|
||||
@@ -4245,7 +4240,6 @@ impl DeviceManager {
|
||||
id.clone(),
|
||||
memory,
|
||||
virtio_device,
|
||||
msix_num,
|
||||
access_platform.as_ref(),
|
||||
self.msi_interrupt_manager.as_ref(),
|
||||
pci_device_bdf.into(),
|
||||
|
||||
Reference in New Issue
Block a user