]> git.ipfire.org Git - thirdparty/systemd.git/commit
vmspawn: don't abort VM launch when an optional swtpm fails to start 42634/head
authorPaul Meyer <katexochen0@gmail.com>
Sat, 13 Jun 2026 10:07:45 +0000 (12:07 +0200)
committerPaul Meyer <katexochen0@gmail.com>
Wed, 17 Jun 2026 08:23:47 +0000 (10:23 +0200)
commitba1203562ef20f84ca746113ad182336c430d2c4
tree516e9674b121ceac831024b9b5c11a308cf6f65c
parentef7d64cd09bda6dbbe5b7a5534f41b0dfe78435e
vmspawn: don't abort VM launch when an optional swtpm fails to start

When start_tpm() failed under TPM autodetect (arg_tpm <= 0), the swtpm
block logged "Failed to start tpm, ignoring" but then fell through to
event_add_child_pidref() with the still-unset child PidRef. That returns
-ESRCH (PIDREF_NULL fails its pidref_is_set() guard), and the VM launch
fails. Register the child only on start_tpm() success.

Co-developed-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
src/vmspawn/vmspawn.c