Skip to content

cmdline: add --reset-exit-code - #125

Draft
willie wants to merge 1 commit into
libkrun:mainfrom
willie:reset-exit-code
Draft

willie wants to merge 1 commit into
libkrun:mainfrom
willie:reset-exit-code

Conversation

@willie

@willie willie commented Nov 10, 2026

Copy link
Copy Markdown

A guest reset and a guest power-off both end krunkit with exit code 0, so the caller cannot tell a reboot from a shutdown and start the VM again.

libkrun 1.19.8 has krun_set_reset_exit_code for this (libkrun/libkrun#986). --reset-exit-code <code> passes the code on. Without the option krunkit does not make the call and nothing changes. Linking now needs libkrun 1.19.8 or newer; the libkrun/krun tap has it.

Tested on an M4 Pro against libkrun v1.19.8 with a Fedora 44 guest booted from EFI: reboot over ssh exits krunkit with 32 when run with --reset-exit-code 32 and with 0 without the option; poweroff exits 0 with the option. cargo test, cargo fmt --check and cargo clippy pass.

A guest reset and a guest power-off both end krunkit with exit code 0,
so the caller cannot tell a reboot from a shutdown and start the VM
again.

libkrun 1.19.8 has krun_set_reset_exit_code for this
(libkrun/libkrun#986). --reset-exit-code <code> passes the code on;
without the option krunkit doesn't make the call and nothing changes.

Signed-off-by: Willie Abrams <willie@pobox.com>
Assisted-by: LLM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant