mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-23 08:21:15 +00:00
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:
parent
e73cb1ff80
commit
d34f31fe7b
@ -272,7 +272,7 @@ impl InterruptManager for KvmInterruptManager {
|
|||||||
|
|
||||||
let mut irq_routes: HashMap<InterruptIndex, InterruptRoute> =
|
let mut irq_routes: HashMap<InterruptIndex, InterruptRoute> =
|
||||||
HashMap::with_capacity(count as usize);
|
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)?);
|
irq_routes.insert(i, InterruptRoute::new(&mut allocator)?);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user