]> git.ipfire.org Git - thirdparty/systemd.git/commit
vmspawn-varlink: treat QMP disconnect as success for Terminate
authorChristian Brauner <brauner@kernel.org>
Mon, 27 Apr 2026 10:34:27 +0000 (12:34 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 27 Apr 2026 13:07:26 +0000 (15:07 +0200)
commit0d6d2c9ebda27a7da2da249458eb44610968bc97
tree9a50bd30667f5b5331f0c3d54863e6af0db1f2df
parentd92b511e4a3e0c877c7cc085e440aecacde32517
vmspawn-varlink: treat QMP disconnect as success for Terminate

QMP "quit" tells QEMU to exit, which races the reply with the socket
EOF: sometimes the disconnect lands in qmp_client_fail_pending() with
-ECONNRESET before the reply has been parsed. The shared completion
callback then translates that into io.systemd.MachineInstance.NotConnected,
turning the desired outcome into a varlink error.

This is exactly what TEST-87-AUX-UTILS-VM exposes during its repeated
start/pause/resume/terminate stress loop: a successful Pause/Describe
followed milliseconds later by a Terminate that fails with NotConnected
when the disconnect path wins the race.

Give Terminate its own completion callback that treats disconnect-class
errors as success, since QEMU shutting down is the whole point of "quit".
The other simple commands (Pause, Resume, PowerOff, Reboot) keep the
existing semantics: they expect QMP to remain alive, so NotConnected is
the correct reply for them.

Link: https://github.com/systemd/systemd/actions/runs/24986080288/job/73159585425?pr=41835
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
src/vmspawn/vmspawn-varlink.c