virtio-devices: iommu: Specify minimum number of queues to avoid OOB

In this way, the virtio-iommu code can properly report an error when
a wrong number of queues is provided, instead of triggering an
out-of-bound error.

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2022-10-19 14:03:29 -07:00 committed by Bo Chen
parent 71b4aad3f1
commit 83f22ac779

View File

@ -905,6 +905,7 @@ impl Iommu {
| 1u64 << VIRTIO_IOMMU_F_PROBE
| 1u64 << VIRTIO_IOMMU_F_BYPASS_CONFIG,
paused_sync: Some(Arc::new(Barrier::new(2))),
min_queues: NUM_QUEUES as u16,
..Default::default()
},
config,