Class WXMFlags

java.lang.Object
com.io7m.waxmill.machines.WXMFlags
All Implemented Interfaces:
WXMFlagsType

public final class WXMFlags
extends java.lang.Object
implements WXMFlagsType
The configuration flags associated with a virtual machine.
  • Method Details

    • includeGuestMemoryInCoreFiles

      public boolean includeGuestMemoryInCoreFiles()
      Include guest memory in core files.
      Specified by:
      includeGuestMemoryInCoreFiles in interface WXMFlagsType
      Returns:
      true if guest memory should appear in core files.
    • yieldCPUOnHLT

      public boolean yieldCPUOnHLT()
      Yield the virtual CPU thread when a HLT instruction is detected. If this option is not specified, virtual CPUs will use 100% of a host CPU.
      Specified by:
      yieldCPUOnHLT in interface WXMFlagsType
      Returns:
      true if the virtual CPU should yield on HLT
    • exitOnPAUSE

      public boolean exitOnPAUSE()
      Force the guest virtual CPU to exit when a PAUSE instruction is detected.
      Specified by:
      exitOnPAUSE in interface WXMFlagsType
      Returns:
      true if the virtual CPU should exit on PAUSE
    • generateACPITables

      public boolean generateACPITables()
      Generate ACPI tables. Required for FreeBSD/amd64 guests.
      Specified by:
      generateACPITables in interface WXMFlagsType
      Returns:
      true if ACPI tables should be generated.
    • disableMPTableGeneration

      public boolean disableMPTableGeneration()
      Disable MP table generation.
      Specified by:
      disableMPTableGeneration in interface WXMFlagsType
      Returns:
      true if generation should be disabled
    • forceVirtualIOPCIToUseMSI

      public boolean forceVirtualIOPCIToUseMSI()
      Force virtio PCI device emulations to use MSI interrupts instead of MSI-X interrupts.
      Specified by:
      forceVirtualIOPCIToUseMSI in interface WXMFlagsType
      Returns:
      true if MSI interrupts should be used
    • guestAPICIsX2APIC

      public boolean guestAPICIsX2APIC()
      The guest's local APIC is configured in x2APIC mode.
      Specified by:
      guestAPICIsX2APIC in interface WXMFlagsType
      Returns:
      true if the guest's local APIC is configured in x2APIC mode.
    • wireGuestMemory

      public boolean wireGuestMemory()
      Wire guest memory.
      Specified by:
      wireGuestMemory in interface WXMFlagsType
      Returns:
      true if the guest's memory should be wired
    • realTimeClockIsUTC

      public boolean realTimeClockIsUTC()
      RTC keeps UTC time.
      Specified by:
      realTimeClockIsUTC in interface WXMFlagsType
      Returns:
      true if the guest's RTC keeps UTC time.
    • withIncludeGuestMemoryInCoreFiles

      public final WXMFlags withIncludeGuestMemoryInCoreFiles​(boolean value)
      Copy the current immutable object by setting a value for the includeGuestMemoryInCoreFiles attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for includeGuestMemoryInCoreFiles
      Returns:
      A modified copy of the this object
    • withYieldCPUOnHLT

      public final WXMFlags withYieldCPUOnHLT​(boolean value)
      Copy the current immutable object by setting a value for the yieldCPUOnHLT attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for yieldCPUOnHLT
      Returns:
      A modified copy of the this object
    • withExitOnPAUSE

      public final WXMFlags withExitOnPAUSE​(boolean value)
      Copy the current immutable object by setting a value for the exitOnPAUSE attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for exitOnPAUSE
      Returns:
      A modified copy of the this object
    • withGenerateACPITables

      public final WXMFlags withGenerateACPITables​(boolean value)
      Copy the current immutable object by setting a value for the generateACPITables attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for generateACPITables
      Returns:
      A modified copy of the this object
    • withDisableMPTableGeneration

      public final WXMFlags withDisableMPTableGeneration​(boolean value)
      Copy the current immutable object by setting a value for the disableMPTableGeneration attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for disableMPTableGeneration
      Returns:
      A modified copy of the this object
    • withForceVirtualIOPCIToUseMSI

      public final WXMFlags withForceVirtualIOPCIToUseMSI​(boolean value)
      Copy the current immutable object by setting a value for the forceVirtualIOPCIToUseMSI attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for forceVirtualIOPCIToUseMSI
      Returns:
      A modified copy of the this object
    • withGuestAPICIsX2APIC

      public final WXMFlags withGuestAPICIsX2APIC​(boolean value)
      Copy the current immutable object by setting a value for the guestAPICIsX2APIC attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for guestAPICIsX2APIC
      Returns:
      A modified copy of the this object
    • withWireGuestMemory

      public final WXMFlags withWireGuestMemory​(boolean value)
      Copy the current immutable object by setting a value for the wireGuestMemory attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for wireGuestMemory
      Returns:
      A modified copy of the this object
    • withRealTimeClockIsUTC

      public final WXMFlags withRealTimeClockIsUTC​(boolean value)
      Copy the current immutable object by setting a value for the realTimeClockIsUTC attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for realTimeClockIsUTC
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals​(java.lang.Object another)
      This instance is equal to all instances of WXMFlags that have equal attribute values.
      Overrides:
      equals in class java.lang.Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: includeGuestMemoryInCoreFiles, yieldCPUOnHLT, exitOnPAUSE, generateACPITables, disableMPTableGeneration, forceVirtualIOPCIToUseMSI, guestAPICIsX2APIC, wireGuestMemory, realTimeClockIsUTC.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

      public java.lang.String toString()
      Prints the immutable value WXMFlags with attribute values.
      Overrides:
      toString in class java.lang.Object
      Returns:
      A string representation of the value
    • copyOf

      public static WXMFlags copyOf​(WXMFlagsType instance)
      Creates an immutable copy of a WXMFlagsType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable WXMFlags instance
    • builder

      public static WXMFlags.Builder builder()
      Creates a builder for WXMFlags.
       WXMFlags.builder()
          .setIncludeGuestMemoryInCoreFiles(boolean) // optional includeGuestMemoryInCoreFiles
          .setYieldCPUOnHLT(boolean) // optional yieldCPUOnHLT
          .setExitOnPAUSE(boolean) // optional exitOnPAUSE
          .setGenerateACPITables(boolean) // optional generateACPITables
          .setDisableMPTableGeneration(boolean) // optional disableMPTableGeneration
          .setForceVirtualIOPCIToUseMSI(boolean) // optional forceVirtualIOPCIToUseMSI
          .setGuestAPICIsX2APIC(boolean) // optional guestAPICIsX2APIC
          .setWireGuestMemory(boolean) // optional wireGuestMemory
          .setRealTimeClockIsUTC(boolean) // optional realTimeClockIsUTC
          .build();
       
      Returns:
      A new WXMFlags builder