Skip to content

Commit

Permalink
fixup! Fix error when terminating the VM
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-carlborg committed Dec 17, 2023
1 parent 9fee7b6 commit f517a82
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 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.

1 change: 0 additions & 1 deletion src/qemu_vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export abstract class Vm extends vm.Vm {
return [
this.hypervisorPath.toString(),
'-daemonize',
'-pidfile', vm.Vm.pidfile,
'-machine', `type=${this.configuration.machineType},accel=${accel}`,
'-cpu', this.configuration.cpu,
'-smp', this.configuration.cpuCount.toString(),
Expand Down
2 changes: 2 additions & 0 deletions src/vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ export abstract class Vm {
)
}

fs.writeFileSync(Vm.pidfile, this.vmProcess.pid.toString())

if (!this.input.shutdownVm) {
this.vmProcess.unref()
}
Expand Down
1 change: 0 additions & 1 deletion src/xhyve_vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export abstract class Vm extends vm.Vm {
'-U', config.uuid,
'-A',
'-H',
'-F', vm.Vm.pidfile,
'-m', config.memory,
'-c', config.cpuCount.toString(),
'-s', '0:0,hostbridge',
Expand Down

0 comments on commit f517a82

Please sign in to comment.