]> git.ipfire.org Git - thirdparty/systemd.git/commit
shared: introduce MachineRegistrationContext to track bus and registration state
authorChristian Brauner <brauner@kernel.org>
Mon, 6 Apr 2026 18:03:21 +0000 (20:03 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 6 Apr 2026 19:42:15 +0000 (21:42 +0200)
commit454d9c1be1056dcf439e73ba550f545d543fffcf
tree90a1e1c3088d6dd05424c32aee3ff8efab82057c
parent2af171653f0c9e3fa36247ff4514f93c7ce0207e
shared: introduce MachineRegistrationContext to track bus and registration state

Bundle scope, buses, and registration success booleans into a
MachineRegistrationContext struct. This eliminates the reterr_registered_system and
reterr_registered_user output parameters from
register_machine_with_fallback_and_log() and the corresponding input
parameters from unregister_machine_with_fallback_and_log().

The struct carries state from registration to unregistration so the
caller no longer needs to manually thread individual booleans between
the two calls.

register_machine_with_fallback_and_log() goes from 7 to 3 parameters,
unregister_machine_with_fallback_and_log() goes from 5 to 2.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
src/nspawn/nspawn.c
src/shared/machine-register.c
src/shared/machine-register.h
src/vmspawn/vmspawn.c