Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/0.0.7'
Browse files Browse the repository at this point in the history
Release: com.io7m.waxmill 0.0.7
Change: Assign VMs UUIDs with the bhyve -U flag (Ticket: #32)
Change: Extended the vm-set command to cover all flags
Change: Use -w by default. (Ticket: #31)
  • Loading branch information
io7m committed Jul 30, 2020
2 parents b1c3708 + 5a886f7 commit 1be34f6
Show file tree
Hide file tree
Showing 35 changed files with 541 additions and 53 deletions.
19 changes: 17 additions & 2 deletions README-CHANGES.xml
Expand Up @@ -53,14 +53,29 @@
</c:change>
</c:changes>
</c:release>
<c:release date="2020-07-29T20:51:26+00:00" ticket-system="com.github.io7m.waxmill" version="0.0.6">
<c:release date="2020-07-29T00:00:00+00:00" ticket-system="com.github.io7m.waxmill" version="0.0.6">
<c:changes>
<c:change date="2020-07-29T00:00:00+00:00" summary="Use short IDs for compatibility with modern Bhyve">
<c:tickets>
<c:ticket id="30"/>
</c:tickets>
</c:change>
<c:change date="2020-07-29T20:51:26+00:00" summary="Add vm-id-of command"/>
<c:change date="2020-07-29T00:00:00+00:00" summary="Add vm-id-of command"/>
</c:changes>
</c:release>
<c:release date="2020-07-30T15:42:16+00:00" ticket-system="com.github.io7m.waxmill" version="0.0.7">
<c:changes>
<c:change date="2020-07-30T00:00:00+00:00" summary="Use -w by default.">
<c:tickets>
<c:ticket id="31"/>
</c:tickets>
</c:change>
<c:change date="2020-07-30T00:00:00+00:00" summary="Extended the vm-set command to cover all flags"/>
<c:change date="2020-07-30T15:42:16+00:00" summary="Assign VMs UUIDs with the bhyve -U flag">
<c:tickets>
<c:ticket id="32"/>
</c:tickets>
</c:change>
</c:changes>
</c:release>
</c:releases>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.boot/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.6</version>
<version>0.0.7</version>
</parent>

<artifactId>com.io7m.waxmill.boot</artifactId>
Expand Down
Expand Up @@ -857,13 +857,17 @@ private void configureBhyveCPUTopology(
private void configureBhyveFlags(
final WXMCommandExecution.Builder cmd)
{
cmd.addArguments("-U");
cmd.addArguments(this.machine.id().toString());

final var flags = this.machine.flags();
configureBhyveFlag(cmd, flags.disableMPTableGeneration(), "-Y");
configureBhyveFlag(cmd, flags.exitOnPAUSE(), "-P");
configureBhyveFlag(cmd, flags.forceVirtualIOPCIToUseMSI(), "-W");
configureBhyveFlag(cmd, flags.generateACPITables(), "-A");
configureBhyveFlag(cmd, flags.guestAPICIsX2APIC(), "-x");
configureBhyveFlag(cmd, flags.includeGuestMemoryInCoreFiles(), "-C");
configureBhyveFlag(cmd, flags.ignoreUnimplementedModelSpecificRegisters(), "-w");
configureBhyveFlag(cmd, flags.realTimeClockIsUTC(), "-u");
configureBhyveFlag(cmd, flags.wireGuestMemory(), "-S");
configureBhyveFlag(cmd, flags.yieldCPUOnHLT(), "-H");
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.client.api/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.6</version>
<version>0.0.7</version>
</parent>

<artifactId>com.io7m.waxmill.client.api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.client.vanilla/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.6</version>
<version>0.0.7</version>
</parent>

<artifactId>com.io7m.waxmill.client.vanilla</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.cmdline/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.6</version>
<version>0.0.7</version>
</parent>

<artifactId>com.io7m.waxmill.cmdline</artifactId>
Expand Down
Expand Up @@ -19,6 +19,7 @@
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.io7m.claypot.core.CLPCommandContextType;
import com.io7m.waxmill.machines.WXMFlags;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -48,6 +49,69 @@ public final class WXMCommandVMSet extends WXMAbstractCommandWithConfiguration
)
private Boolean wireGuestMemory;

@Parameter(
names = "--include-guest-memory-cores",
description = "Include guest memory in core files.",
arity = 1
)
private Boolean includeGuestMemoryInCoreFiles;

@Parameter(
names = "--yield-on-HLT",
description = "Yield the virtual CPU thread when a HLT instruction is detected.",
arity = 1
)
private Boolean yieldOnHLT;

@Parameter(
names = "--exit-on-PAUSE",
description = "Force the guest virtual CPU to exit when a PAUSE instruction is detected.",
arity = 1
)
private Boolean exitOnPAUSE;

@Parameter(
names = "--generate-acpi-tables",
description = "Generate ACPI tables. Required for FreeBSD/amd64 guests.",
arity = 1
)
private Boolean generateACPITables;

@Parameter(
names = "--disable-mptable-generation",
description = "Disable MP table generation.",
arity = 1
)
private Boolean disableMPTableGeneration;

@Parameter(
names = "--force-msi-interrupts",
description = "Force virtio PCI device emulations to use MSI interrupts instead of MSI-X interrupts.",
arity = 1
)
private Boolean forceMSIInterrupts;

@Parameter(
names = "--guest-apic-is-x2apic",
description = "The guest's local APIC is configured in x2APIC mode.",
arity = 1
)
private Boolean guestAPICIsX2APIC;

@Parameter(
names = "--rtc-is-utc",
description = "RTC keeps UTC time.",
arity = 1
)
private Boolean realTimeClockIsUTC;

@Parameter(
names = "--ignore-unimplemented-msr",
description = "Ignore accesses to unimplemented Model Specific Registers.",
arity = 1
)
private Boolean ignoreUnimplementedModelSpecificRegisters;

/**
* Construct a command.
*
Expand Down Expand Up @@ -80,13 +144,67 @@ protected Status executeActualWithConfiguration(
try (var client = WXMServices.clients().open(configurationPath)) {
final var machine = client.vmFind(this.id);

var flags = machine.flags();
if (this.wireGuestMemory != null) {
flags = flags.withWireGuestMemory(this.wireGuestMemory.booleanValue());
}
final var flagBuilder =
WXMFlags.builder()
.from(machine.flags());

client.vmUpdate(machine.withFlags(flags));
handleFlag(
this.disableMPTableGeneration,
flagBuilder::setDisableMPTableGeneration
);
handleFlag(
this.exitOnPAUSE,
flagBuilder::setExitOnPAUSE
);
handleFlag(
this.forceMSIInterrupts,
flagBuilder::setForceVirtualIOPCIToUseMSI
);
handleFlag(
this.generateACPITables,
flagBuilder::setGenerateACPITables
);
handleFlag(
this.guestAPICIsX2APIC,
flagBuilder::setGuestAPICIsX2APIC
);
handleFlag(
this.ignoreUnimplementedModelSpecificRegisters,
flagBuilder::setIgnoreUnimplementedModelSpecificRegisters
);
handleFlag(
this.includeGuestMemoryInCoreFiles,
flagBuilder::setIncludeGuestMemoryInCoreFiles
);
handleFlag(
this.realTimeClockIsUTC,
flagBuilder::setRealTimeClockIsUTC
);
handleFlag(
this.wireGuestMemory,
flagBuilder::setWireGuestMemory
);
handleFlag(
this.yieldOnHLT,
flagBuilder::setYieldCPUOnHLT
);

client.vmUpdate(machine.withFlags(flagBuilder.build()));
}
return SUCCESS;
}

interface FlagSetterType
{
void set(boolean flag);
}

private static void handleFlag(
final Boolean flag,
final FlagSetterType flagSetter)
{
if (flag != null) {
flagSetter.set(flag.booleanValue());
}
}
}
Expand Up @@ -35,7 +35,7 @@ WAXMILL_JAR_FILE="${WAXMILL_HOME}/${WAXMILL_JAR_NAME}"

if [ ! -z "${WAXMILL_JVM_OPTIONS}" ]
then
exec java "${WAXMILL_JVM_OPTIONS}" -jar "${WAXMILL_JAR_FILE}" "$@"
exec java ${WAXMILL_JVM_OPTIONS} -jar "${WAXMILL_JAR_FILE}" "$@"
else
exec java -jar "${WAXMILL_JAR_FILE}" "$@"
fi
@@ -0,0 +1,28 @@
#!/bin/sh
#
# Copyright © 2020 Mark Raynsford <code@io7m.com> https://www.io7m.com
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
# IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

WJO=""
WJO="${WJO} -XX:+UseSerialGC"
WJO="${WJO} -XX:-UseCompressedClassPointers"
WJO="${WJO} -XX:MaxMetaspaceSize=32m"
WJO="${WJO} -XX:MetaspaceSize=32m"
WJO="${WJO} -XX:TieredStopAtLevel=2"
WJO="${WJO} -Xms16m"
WJO="${WJO} -Xmx16m"

export WAXMILL_JVM_OPTIONS="${WJO}"
exec waxmill "$@"
2 changes: 1 addition & 1 deletion com.io7m.waxmill.database.api/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.6</version>
<version>0.0.7</version>
</parent>

<artifactId>com.io7m.waxmill.database.api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.database.vanilla/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.6</version>
<version>0.0.7</version>
</parent>

<artifactId>com.io7m.waxmill.database.vanilla</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.waxmill.documentation/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.waxmill</artifactId>
<groupId>com.io7m.waxmill</groupId>
<version>0.0.6</version>
<version>0.0.7</version>
</parent>

<artifactId>com.io7m.waxmill.documentation</artifactId>
Expand Down

0 comments on commit 1be34f6

Please sign in to comment.