vmm: Fix KvmInterruptManager when base is different from 0

When the base InterruptIndex is different from 0, the loop allocating
GSI and HashMap entries won't work as expected. The for loop needs to
start from base, but the limit must be base+count so that we allocate
a number of "count" entries.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2020-01-20 11:31:01 +01:00 committed by Samuel Ortiz
parent e73cb1ff80
commit d34f31fe7b

View File

@ -272,7 +272,7 @@ impl InterruptManager for KvmInterruptManager {
let mut irq_routes: HashMap<InterruptIndex, InterruptRoute> =
HashMap::with_capacity(count as usize);
for i in base..count {
for i in base..base + count {
irq_routes.insert(i, InterruptRoute::new(&mut allocator)?);
}