From c15ef219e521a1f23de8bef57b273c9a632c0dab Mon Sep 17 00:00:00 2001 From: Liam Merwick Date: Thu, 30 Jul 2020 15:01:47 +0100 Subject: [PATCH] qemu: Set govmmQemu NoReboot config Knob The Kata architecture does not support rebooting VMs (the lifecycle being start/exec/kill) and if a VM is killed (e.g. using sysrq-trigger), the VM does not exit fully and other layers do not notice the state change. Set the NoReboot config Knob so that govmmQemu.LaunchQemu() runs QEMU with the --no-reboot command-line option. Fixes: #2866 Signed-off-by: Liam Merwick --- src/runtime/virtcontainers/qemu.go | 1 + src/runtime/virtcontainers/qemu_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/src/runtime/virtcontainers/qemu.go b/src/runtime/virtcontainers/qemu.go index 74b83c1bdd..f1a3cb1d57 100644 --- a/src/runtime/virtcontainers/qemu.go +++ b/src/runtime/virtcontainers/qemu.go @@ -481,6 +481,7 @@ func (q *qemu) createSandbox(ctx context.Context, id string, networkNS NetworkNa NoUserConfig: true, NoDefaults: true, NoGraphic: true, + NoReboot: true, Daemonize: true, MemPrealloc: q.config.MemPrealloc, HugePages: q.config.HugePages, diff --git a/src/runtime/virtcontainers/qemu_test.go b/src/runtime/virtcontainers/qemu_test.go index 430a5419dd..15e4de64c1 100644 --- a/src/runtime/virtcontainers/qemu_test.go +++ b/src/runtime/virtcontainers/qemu_test.go @@ -202,6 +202,7 @@ func TestQemuKnobs(t *testing.T) { assert.Equal(q.qemuConfig.Knobs.NoUserConfig, true) assert.Equal(q.qemuConfig.Knobs.NoDefaults, true) assert.Equal(q.qemuConfig.Knobs.NoGraphic, true) + assert.Equal(q.qemuConfig.Knobs.NoReboot, true) } func testQemuAddDevice(t *testing.T, devInfo interface{}, devType deviceType, expected []govmmQemu.Device) {