[systemd-devel] List all available units

Václav Pavlín vpavlin at redhat.com
Tue Aug 7 07:35:54 PDT 2012


Hi everyone,

I started to work on these two bugs (if I solve the first one, the
second one will be almost solved as well):

https://bugzilla.redhat.com/show_bug.cgi?id=748512
https://bugzilla.redhat.com/show_bug.cgi?id=790768

My idea is to get list of loaded units, then list of unit files and then
get info for units, which are in file list, but not in list of loaded
units. Then I can print info for all units available in the system
(whether they are loaded or not).

I would extract code responsible for loading unit_infos from
systemctl.c/list_units to the function (so it will be reusable) and do
the same with the systemctl.c/lis_unit_files.

I would like to use hashmap to store loaded units, because it will be
faster, than using array, to check it against unit file list. With this
it would be nice to use hashmap directly in functions list_units and
output_units_list, so I don't have to move data from array to hashmap
and back to array.

I would like to know your opinion and/or suggestions how to solve this
better.

Thanks

Václav Pavlín



More information about the systemd-devel mailing list