From fe83c208dceef6f9206db43abb5d6c7340df9a1f Mon Sep 17 00:00:00 2001 From: Manohar Castelino Date: Thu, 2 Sep 2021 16:05:06 -0700 Subject: [PATCH] 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 --- qemu/qemu.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qemu/qemu.go b/qemu/qemu.go index ee814a9c6b..13d8ab33a4 100644 --- a/qemu/qemu.go +++ b/qemu/qemu.go @@ -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 } @@ -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") }