core: implement Kill/Automount/Mount Context/Runtime for io.systemd.Unit.List (#39391)

The PR implements the following objects + tests for
`io.systemd.Unit.List`:
- `KillContext`
- `AutomountContext`
- `AutomountRuntime`
- `MountContext`
- `MountRuntime`

It's a continuation of the following PRs:
* https://github.com/systemd/systemd/pull/37432
* https://github.com/systemd/systemd/pull/37646
* https://github.com/systemd/systemd/pull/38032
* https://github.com/systemd/systemd/pull/38212
This commit is contained in:
Lennart Poettering
2026-04-20 22:57:21 +02:00
committed by GitHub
18 changed files with 358 additions and 16 deletions
+8
View File
@@ -72,6 +72,14 @@ const char* unit_dbus_interface_from_name(const char *name) {
return unit_dbus_interface_from_type(t);
}
const char* unit_type_to_capitalized_string(UnitType t) {
const char *di = unit_dbus_interface_from_type(t);
if (!di)
return NULL;
return ASSERT_PTR(startswith(di, "org.freedesktop.systemd1."));
}
static const char* const unit_type_table[_UNIT_TYPE_MAX] = {
[UNIT_SERVICE] = "service",
[UNIT_SOCKET] = "socket",
+1
View File
@@ -321,6 +321,7 @@ void unit_types_list(void);
DECLARE_STRING_TABLE_LOOKUP(unit_load_state, UnitLoadState);
DECLARE_STRING_TABLE_LOOKUP(unit_active_state, UnitActiveState);
const char* unit_type_to_capitalized_string(UnitType t);
DECLARE_STRING_TABLE_LOOKUP(freezer_state, FreezerState);
FreezerState freezer_state_finish(FreezerState state) _const_;