libkrun v1.19.4 fork adding PVH boot primitives (start_info + protected-mode vCPU state) for faster, kernel-direct x86_64 microVM startup.

init: tolerate closed stdio when the console is not yet ready master

The kernel's handoff of stdin/stdout/stderr to PID 1 is best-effort: if hvc0 is not registered when the kernel execs init, init inherits closed fds 0/1/2 ("unable to open an initial console" in the kernel log). Rust std's sanitize_standard_fds() then runs before main(), cannot backfill /dev/null (devtmpfs is unmounted), and aborts -- rebooting before the workload runs. This is the flaky configure-vm-2cpu-1GiB failure (empty output): boot timing intermittently delays hvc0 (gated on the secondary vCPU) past the kernel's initial-console-open. KRUN_ENOMEM_WORKAROUND widens the window; the race is latent without it. A C init tolerates closed stdio. Restore that with an .init_array constructor that reopens 0/1/2 (console, else /dev/null) before the runtime check; setup_redirects() rewires them to the krun ports as before. Assisted-by: Claude Code / claude-opus-4.8 Signed-off-by: ZauberNerd <zaubernerd@zaubernerd.de>


+44
1 changed file