Implement kexec reboot support for SSH mode#20
Open
aleksandrov-denis wants to merge 7 commits into
Open
Conversation
4ed3d67 to
6d12ccf
Compare
coiby
requested changes
Apr 16, 2026
Member
|
Thanks for opening this PR! Good to know the rebooting speed has greatly improved. Besides suggestions in inline code comment, you can change one of the integration tests to adopt the kexec reboot strategy so this feature will be covered. Btw, you may want to link this PR to #7. @gemini-cli /review |
2e7df94 to
15e3698
Compare
Author
|
All comments should be resolved with the latest changes, let me know what you think :)) |
coiby
requested changes
May 8, 2026
Member
Thanks for addressing my feedback! The PR LGTM to me except for one requested change. |
do_kexec_reboot() was a stub that always fell back to a full reboot. Implement it properly for SSH mode, where CRIU is not involved and kexec is safe to use. Add kexec_load_kernel() to lib.sh which validates that the kernel and initramfs files exist, reads the current command line from /proc/cmdline, and loads the new kernel into memory with kexec -l. Add kab_kexec() which executes the loaded kernel via reboot_and_wait. In local/CRIU mode, kexec bypasses the normal boot sequence that CRIU relies on to restart the daemon, so the existing fallback to full reboot is preserved. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The dnf install output was being redirected to /var/log/install.log on the controller machine (local shell redirect), which fails when the controller runs as a non-root user. Pass the redirect as an argument to run_cmd so it is evaluated on the test host, consistent with how install_from_git handles its build log. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two improvements based on review feedback: Use kexec --reuse-cmdline instead of reading /proc/cmdline manually. This avoids passing bootloader-specific parameters like BOOT_IMAGE= that kexec does not need and which can vary across boot environments. Extend kexec support to local/CRIU mode. kexec still performs a full Linux boot, so the CRIU daemon restarts via cron and can restore the bisect process normally. kab_kexec() now signals the daemon with a "kexec" checkpoint type, which triggers kexec -e after checkpointing. criu-daemon.sh is updated to recognise and allow kexec -e commands. do_kexec_reboot() no longer special-cases CRIU mode. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Set REBOOT_STRATEGY="kexec" in the SSH integration test so that the kexec code path gets exercised on every test run. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
kexec-tools was only installed as part of kdump setup, which only runs when TEST_STRATEGY="panic". A user running REBOOT_STRATEGY="kexec" with TEST_STRATEGY="simple" would get a missing kexec binary. Install kexec-tools at the start of setup_kdump() whenever REBOOT_STRATEGY="kexec" is set, independent of the test strategy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Set REBOOT_STRATEGY="kexec" so the CRIU integration test exercises the kexec+CRIU code path: the kernel is loaded via kexec -l and the CRIU daemon checkpoints kab before executing kexec -e, then restores it after the system comes back up. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Denis Aleksandrov <daleksan@redhat.com>
940ecd6 to
fbb3d6d
Compare
Author
|
Most recent commit addresses the last concern in review, please let me know if there is anything else that should be fixed :)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
REBOOT_STRATEGY=kexec was documented and configurable but not implemented — do_kexec_reboot() was a
stub that always fell back to a full system reboot. This PR implements it for SSH mode, reducing
per-iteration reboot time from ~60s to ~18s.
Changes
Implement kexec support for SSH mode
Adds two helpers to lib.sh:
host, reads the current kernel command line from /proc/cmdline, and loads the new kernel into memory
with kexec -l
Updates do_kexec_reboot() in reboot_handler.sh:
otherwise executes with kab_kexec
boot sequence that the CRIU daemon relies on to restore the bisect process
install_from_rpm: redirect dnf output on the test host
Fixes a bug where dnf install output in install_from_rpm was redirected to /var/log/install.log via a
local shell redirect, which fails when the controller runs as a non-root user. The redirect is now
passed as an argument to run_cmd so it executes on the test host — consistent with how install_from_git
handles its build log.
Testing
Tested end-to-end on RHEL 9.8 in SSH mode (INSTALL_STRATEGY=rpm, TEST_STRATEGY=simple,
REBOOT_STRATEGY=kexec) bisecting across three CentOS Stream 9 kernel versions (5.14.0-687/688/689):
Resolves #7