Package com.io7m.waxmill.machines
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.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWXMFlags.BuilderBuilds instances of typeWXMFlags. -
Method Summary
Modifier and Type Method Description static WXMFlags.Builderbuilder()Creates a builder forWXMFlags.static WXMFlagscopyOf(WXMFlagsType instance)Creates an immutable copy of aWXMFlagsTypevalue.booleandisableMPTableGeneration()Disable MP table generation.booleanequals(java.lang.Object another)This instance is equal to all instances ofWXMFlagsthat have equal attribute values.booleanexitOnPAUSE()Force the guest virtual CPU to exit when a PAUSE instruction is detected.booleanforceVirtualIOPCIToUseMSI()Force virtio PCI device emulations to use MSI interrupts instead of MSI-X interrupts.booleangenerateACPITables()Generate ACPI tables.booleanguestAPICIsX2APIC()The guest's local APIC is configured in x2APIC mode.inthashCode()Computes a hash code from attributes:includeGuestMemoryInCoreFiles,yieldCPUOnHLT,exitOnPAUSE,generateACPITables,disableMPTableGeneration,forceVirtualIOPCIToUseMSI,guestAPICIsX2APIC,wireGuestMemory,realTimeClockIsUTC,ignoreUnimplementedModelSpecificRegisters.booleanignoreUnimplementedModelSpecificRegisters()Ignore accesses to unimplemented Model Specific Registers (MSRs).booleanincludeGuestMemoryInCoreFiles()Include guest memory in core files.booleanrealTimeClockIsUTC()RTC keeps UTC time.java.lang.StringtoString()Prints the immutable valueWXMFlagswith attribute values.booleanwireGuestMemory()Wire guest memory.WXMFlagswithDisableMPTableGeneration(boolean value)Copy the current immutable object by setting a value for thedisableMPTableGenerationattribute.WXMFlagswithExitOnPAUSE(boolean value)Copy the current immutable object by setting a value for theexitOnPAUSEattribute.WXMFlagswithForceVirtualIOPCIToUseMSI(boolean value)Copy the current immutable object by setting a value for theforceVirtualIOPCIToUseMSIattribute.WXMFlagswithGenerateACPITables(boolean value)Copy the current immutable object by setting a value for thegenerateACPITablesattribute.WXMFlagswithGuestAPICIsX2APIC(boolean value)Copy the current immutable object by setting a value for theguestAPICIsX2APICattribute.WXMFlagswithIgnoreUnimplementedModelSpecificRegisters(boolean value)Copy the current immutable object by setting a value for theignoreUnimplementedModelSpecificRegistersattribute.WXMFlagswithIncludeGuestMemoryInCoreFiles(boolean value)Copy the current immutable object by setting a value for theincludeGuestMemoryInCoreFilesattribute.WXMFlagswithRealTimeClockIsUTC(boolean value)Copy the current immutable object by setting a value for therealTimeClockIsUTCattribute.WXMFlagswithWireGuestMemory(boolean value)Copy the current immutable object by setting a value for thewireGuestMemoryattribute.WXMFlagswithYieldCPUOnHLT(boolean value)Copy the current immutable object by setting a value for theyieldCPUOnHLTattribute.booleanyieldCPUOnHLT()Yield the virtual CPU thread when a HLT instruction is detected.
-
Method Details
-
includeGuestMemoryInCoreFiles
public boolean includeGuestMemoryInCoreFiles()Include guest memory in core files.- Specified by:
includeGuestMemoryInCoreFilesin interfaceWXMFlagsType- Returns:
trueif guest memory should appear in core files.- See Also:
- "-C option to bhyve"
-
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:
yieldCPUOnHLTin interfaceWXMFlagsType- Returns:
trueif the virtual CPU should yield on HLT- See Also:
- "-H option to bhyve"
-
exitOnPAUSE
public boolean exitOnPAUSE()Force the guest virtual CPU to exit when a PAUSE instruction is detected.- Specified by:
exitOnPAUSEin interfaceWXMFlagsType- Returns:
trueif the virtual CPU should exit on PAUSE- See Also:
- "-P option to bhyve"
-
generateACPITables
public boolean generateACPITables()Generate ACPI tables. Required for FreeBSD/amd64 guests.- Specified by:
generateACPITablesin interfaceWXMFlagsType- Returns:
trueif ACPI tables should be generated.- See Also:
- "-A option to bhyve"
-
disableMPTableGeneration
public boolean disableMPTableGeneration()Disable MP table generation.- Specified by:
disableMPTableGenerationin interfaceWXMFlagsType- Returns:
trueif generation should be disabled- See Also:
- "-Y option to bhyve"
-
forceVirtualIOPCIToUseMSI
public boolean forceVirtualIOPCIToUseMSI()Force virtio PCI device emulations to use MSI interrupts instead of MSI-X interrupts.- Specified by:
forceVirtualIOPCIToUseMSIin interfaceWXMFlagsType- Returns:
trueif MSI interrupts should be used- See Also:
- "-W option to bhyve"
-
guestAPICIsX2APIC
public boolean guestAPICIsX2APIC()The guest's local APIC is configured in x2APIC mode.- Specified by:
guestAPICIsX2APICin interfaceWXMFlagsType- Returns:
trueif the guest's local APIC is configured in x2APIC mode.- See Also:
- "-x option to bhyve"
-
wireGuestMemory
public boolean wireGuestMemory()Wire guest memory.- Specified by:
wireGuestMemoryin interfaceWXMFlagsType- Returns:
trueif the guest's memory should be wired- See Also:
- "-S option to bhyve"
-
realTimeClockIsUTC
public boolean realTimeClockIsUTC()RTC keeps UTC time.- Specified by:
realTimeClockIsUTCin interfaceWXMFlagsType- Returns:
trueif the guest's RTC keeps UTC time.- See Also:
- "-u option to bhyve"
-
ignoreUnimplementedModelSpecificRegisters
public boolean ignoreUnimplementedModelSpecificRegisters()Ignore accesses to unimplemented Model Specific Registers (MSRs). This is intended for debug purposes.- Specified by:
ignoreUnimplementedModelSpecificRegistersin interfaceWXMFlagsType- Returns:
trueif unimplemented accesses should be ignored- See Also:
- "-w option to bhyve"
-
withIncludeGuestMemoryInCoreFiles
Copy the current immutable object by setting a value for theincludeGuestMemoryInCoreFilesattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for includeGuestMemoryInCoreFiles- Returns:
- A modified copy of the
thisobject
-
withYieldCPUOnHLT
Copy the current immutable object by setting a value for theyieldCPUOnHLTattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for yieldCPUOnHLT- Returns:
- A modified copy of the
thisobject
-
withExitOnPAUSE
Copy the current immutable object by setting a value for theexitOnPAUSEattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for exitOnPAUSE- Returns:
- A modified copy of the
thisobject
-
withGenerateACPITables
Copy the current immutable object by setting a value for thegenerateACPITablesattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for generateACPITables- Returns:
- A modified copy of the
thisobject
-
withDisableMPTableGeneration
Copy the current immutable object by setting a value for thedisableMPTableGenerationattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for disableMPTableGeneration- Returns:
- A modified copy of the
thisobject
-
withForceVirtualIOPCIToUseMSI
Copy the current immutable object by setting a value for theforceVirtualIOPCIToUseMSIattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for forceVirtualIOPCIToUseMSI- Returns:
- A modified copy of the
thisobject
-
withGuestAPICIsX2APIC
Copy the current immutable object by setting a value for theguestAPICIsX2APICattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for guestAPICIsX2APIC- Returns:
- A modified copy of the
thisobject
-
withWireGuestMemory
Copy the current immutable object by setting a value for thewireGuestMemoryattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for wireGuestMemory- Returns:
- A modified copy of the
thisobject
-
withRealTimeClockIsUTC
Copy the current immutable object by setting a value for therealTimeClockIsUTCattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for realTimeClockIsUTC- Returns:
- A modified copy of the
thisobject
-
withIgnoreUnimplementedModelSpecificRegisters
Copy the current immutable object by setting a value for theignoreUnimplementedModelSpecificRegistersattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for ignoreUnimplementedModelSpecificRegisters- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofWXMFlagsthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:includeGuestMemoryInCoreFiles,yieldCPUOnHLT,exitOnPAUSE,generateACPITables,disableMPTableGeneration,forceVirtualIOPCIToUseMSI,guestAPICIsX2APIC,wireGuestMemory,realTimeClockIsUTC,ignoreUnimplementedModelSpecificRegisters.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueWXMFlagswith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aWXMFlagsTypevalue. 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
Creates a builder forWXMFlags.WXMFlags.builder() .setIncludeGuestMemoryInCoreFiles(boolean) // optionalincludeGuestMemoryInCoreFiles.setYieldCPUOnHLT(boolean) // optionalyieldCPUOnHLT.setExitOnPAUSE(boolean) // optionalexitOnPAUSE.setGenerateACPITables(boolean) // optionalgenerateACPITables.setDisableMPTableGeneration(boolean) // optionaldisableMPTableGeneration.setForceVirtualIOPCIToUseMSI(boolean) // optionalforceVirtualIOPCIToUseMSI.setGuestAPICIsX2APIC(boolean) // optionalguestAPICIsX2APIC.setWireGuestMemory(boolean) // optionalwireGuestMemory.setRealTimeClockIsUTC(boolean) // optionalrealTimeClockIsUTC.setIgnoreUnimplementedModelSpecificRegisters(boolean) // optionalignoreUnimplementedModelSpecificRegisters.build();- Returns:
- A new WXMFlags builder
-