Interface InterruptAllocator
public interface InterruptAllocator
Allows reserving interrupts on the primary interrupt controller of a virtual machine
during a
VMDevice.mount(VMContext) call.
Allocated interrupts should be persisted and used in claimInterrupt(int)
when restoring from a saved state to ensure correct behavior of the loaded virtual
machine.
-
Method Summary
Modifier and TypeMethodDescriptionTries to claim the next free interrupt.booleanclaimInterrupt(int interrupt) Tries to reserve an interrupt with the specified index.
-
Method Details
-
claimInterrupt
boolean claimInterrupt(int interrupt) Tries to reserve an interrupt with the specified index. This may fail if the interrupt has already been claimed. UseclaimInterrupt()to obtain a free interrupt.- Parameters:
interrupt- the interrupt to claim.- Returns:
trueif the interrupt could be claimed;falseotherwise.
-
claimInterrupt
OptionalInt claimInterrupt()Tries to claim the next free interrupt. If no more interrupts are available, this will returnOptional.empty().- Returns:
- the interrupt that was claimed, if any.
-