shared/bus-unit-util: add bus_dump_transient_settings() helper
bus_append_unit_property() and associated functions accept a long list of properties. But the specific names are only available through code. But it is useful to be able to know the specific list of properties that is supported, in particular for shell completions. Thus, add a way to list the properties that are supported by the code. In the future we could also turn this into a test for the documentation. For various reasons, the list of properties listed in the docs is a partially overlapping set. E.g. for service type, the pull request https://github.com/systemd/systemd/pull/37661 creates a list with 212 entries, and this code generates 7 entries less and 184 more. I didn't check all the differences, but in the few cases I did, the list generated here was actually correctly supported by 'systemd-run -p'. A smoke test is added.
This commit is contained in:
@@ -2063,6 +2063,10 @@ static const char* const cgroup_io_limit_type_table[_CGROUP_IO_LIMIT_TYPE_MAX] =
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(cgroup_io_limit_type, CGroupIOLimitType);
|
||||
|
||||
void cgroup_io_limits_list(void) {
|
||||
DUMP_STRING_TABLE(cgroup_io_limit_type, CGroupIOLimitType, _CGROUP_IO_LIMIT_TYPE_MAX);
|
||||
}
|
||||
|
||||
static const char *const cgroup_controller_table[_CGROUP_CONTROLLER_MAX] = {
|
||||
[CGROUP_CONTROLLER_CPU] = "cpu",
|
||||
[CGROUP_CONTROLLER_CPUACCT] = "cpuacct",
|
||||
|
||||
Reference in New Issue
Block a user