Skip to content

Commit

Permalink
qemu: Add support for --no-shutdown Knob
Browse files Browse the repository at this point in the history
Add support for --no-shutdown Knob. This allows us to
shutdown the VM without quitting QEMU.

Note: Also fix the comment around --no-reboot to be
more accurate.

Signed-off-by: Manohar Castelino <mcastelino@apple.com>
  • Loading branch information
Manohar Castelino committed Sep 16, 2021
1 parent 1ed5271 commit fe83c20
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions qemu/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -2402,8 +2402,12 @@ type Knobs struct {
Realtime bool

// Exit instead of rebooting
// Prevents QEMU from rebooting in the event of a Triple Fault.
NoReboot bool

// Don’t exit QEMU on guest shutdown, but instead only stop the emulation.
NoShutdown bool

// IOMMUPlatform will enable IOMMU for supported devices
IOMMUPlatform bool
}
Expand Down Expand Up @@ -2776,6 +2780,10 @@ func (config *Config) appendKnobs() {
config.qemuParams = append(config.qemuParams, "--no-reboot")
}

if config.Knobs.NoShutdown {
config.qemuParams = append(config.qemuParams, "--no-shutdown")
}

if config.Knobs.Daemonize {
config.qemuParams = append(config.qemuParams, "-daemonize")
}
Expand Down

0 comments on commit fe83c20

Please sign in to comment.