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 Type
    Method
    Description
    Tries to claim the next free interrupt.
    boolean
    claimInterrupt(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. Use claimInterrupt() to obtain a free interrupt.
      Parameters:
      interrupt - the interrupt to claim.
      Returns:
      true if the interrupt could be claimed; false otherwise.
    • claimInterrupt

      OptionalInt claimInterrupt()
      Tries to claim the next free interrupt. If no more interrupts are available, this will return Optional.empty().
      Returns:
      the interrupt that was claimed, if any.