Skip to content

Commit

Permalink
fixup! debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-carlborg committed Feb 17, 2024
1 parent 310f6ab commit 5da3f65
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
13 changes: 11 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/host_qemu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default abstract class HostQemu {

static readonly LinuxHostQemu = class extends HostQemu {
override get cpu(): string {
return 'host'
return 'max'
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/operating_systems/openbsd/qemu_vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ export class QemuVm extends Vm {
protected override get netDevive(): string {
return this.architecture.networkDevice
}

protected override get accelerators(): string[] {
return this.input.version.startsWith('6')
? ['hvf', 'tcg']
: ['hvf', 'kvm', 'tcg']
}
}

export class QemuVmX86_64 extends QemuVm {
Expand Down
8 changes: 7 additions & 1 deletion src/qemu_vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ export abstract class Vm extends vm.Vm {
}

override get command(): string[] {
const accelerators = this.accelerators.join(':')

// prettier-ignore
return [
this.hypervisorPath.toString(),
'-daemonize',
'-machine', `type=${this.configuration.machineType},accel=hvf:kvm:tcg`,
'-machine', `type=${this.configuration.machineType},accel=${accelerators}`,
'-cpu', this.cpuFlagValue,
'-smp', this.configuration.cpuCount.toString(),
'-m', this.configuration.memory,
Expand Down Expand Up @@ -83,6 +85,10 @@ export abstract class Vm extends vm.Vm {
return ['-bios', this.configuration.firmware!.toString()]
}

protected get accelerators(): string[] {
return ['hvf', 'kvm', 'tcg']
}

private get netdev(): string {
return [
'user',
Expand Down
2 changes: 1 addition & 1 deletion src/vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export abstract class Vm {
protected readonly hypervisorDirectory: fs.PathLike
protected readonly resourcesDirectory: fs.PathLike

private readonly input: Input
protected readonly input: Input

constructor(
hypervisorDirectory: fs.PathLike,
Expand Down

0 comments on commit 5da3f65

Please sign in to comment.