Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

qemu: Add NoReboot config Knob for qemuParams #131

Merged
merged 1 commit into from
Jul 28, 2020

Conversation

merwick
Copy link
Contributor

@merwick merwick commented Jul 27, 2020

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.
Kata needs a way to tell QEMU to run with the '--no-reboot' option
so that the guest VM exits and does not attempt to reboot.

Add a NoReboot boolean Knob so when Knobs.NoReboot is set, the '--no-reboot'
command-line option will be passed to QEMU on startup.

Signed-off-by: Liam Merwick [email protected]

@merwick
Copy link
Contributor Author

merwick commented Jul 27, 2020

Adding this PR to govmm would allow the following change to kata-runtime to complete the fix (once this PR was vendored in)

+++ b/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,

@devimc
Copy link

devimc commented Jul 27, 2020

thanks @merwick l g tm, could you update the unit test?

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.
Kata needs a way to tell QEMU to run with the '--no-reboot' option
so that the guest VM exits and does not attempt to reboot.

Add a NoReboot boolean Knob so when Knobs.NoReboot is set, the '--no-reboot'
command-line option will be passed to QEMU on startup.

Signed-off-by: Liam Merwick <[email protected]>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 81.18% when pulling 6645baf on merwick:master into af9e34b on intel:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 81.18% when pulling 6645baf on merwick:master into af9e34b on intel:master.

Copy link
Collaborator

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @merwick.

lgtm

Copy link

@devimc devimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@devimc devimc merged commit 6c3315b into kata-containers:master Jul 28, 2020
merwick added a commit to merwick/runtime that referenced this pull request Jul 29, 2020
Bring support for '--no-reboot' QEMU parameter (kata-containers/govmm#131)

shortlog:
qemu: Add NoReboot config Knob for qemuParams

Signed-off-by: Liam Merwick <[email protected]>
merwick added a commit to merwick/runtime that referenced this pull request Jul 30, 2020
Bring support for '--no-reboot' QEMU parameter (kata-containers/govmm#131)

shortlog:
qemu: Add NoReboot config Knob for qemuParams

Signed-off-by: Liam Merwick <[email protected]>
merwick added a commit to merwick/kata-containers that referenced this pull request Jul 30, 2020
Bring support for '--no-reboot' QEMU parameter (kata-containers/govmm#131)

shortlog:
qemu: Add NoReboot config Knob for qemuParams

Signed-off-by: Liam Merwick <[email protected]>
merwick added a commit to merwick/kata-containers that referenced this pull request Jul 30, 2020
Bring support for '--no-reboot' QEMU parameter (kata-containers/govmm#131)

shortlog:
qemu: Add NoReboot config Knob for qemuParams

Signed-off-by: Liam Merwick <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants