qemu: Add support for --no-shutdown Knob

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>
This commit is contained in:
Manohar Castelino 2021-09-02 16:05:06 -07:00
parent 1ed52714c0
commit fe83c208dc

View File

@ -2402,8 +2402,12 @@ type Knobs struct {
Realtime bool Realtime bool
// Exit instead of rebooting // Exit instead of rebooting
// Prevents QEMU from rebooting in the event of a Triple Fault.
NoReboot bool NoReboot bool
// Dont exit QEMU on guest shutdown, but instead only stop the emulation.
NoShutdown bool
// IOMMUPlatform will enable IOMMU for supported devices // IOMMUPlatform will enable IOMMU for supported devices
IOMMUPlatform bool IOMMUPlatform bool
} }
@ -2776,6 +2780,10 @@ func (config *Config) appendKnobs() {
config.qemuParams = append(config.qemuParams, "--no-reboot") config.qemuParams = append(config.qemuParams, "--no-reboot")
} }
if config.Knobs.NoShutdown {
config.qemuParams = append(config.qemuParams, "--no-shutdown")
}
if config.Knobs.Daemonize { if config.Knobs.Daemonize {
config.qemuParams = append(config.qemuParams, "-daemonize") config.qemuParams = append(config.qemuParams, "-daemonize")
} }