X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Funit.h;h=81b8adbfdc7f43b6fb4b3e972a660affc2d70a44;hp=b04475e4fb8351e605615b6db9d124cf1ba1aa32;hb=a016b9228f338cb9b380ce7e00826ef462767d98;hpb=c647f10918940b5d11870df6d008c6c3180bdc41 diff --git a/src/core/unit.h b/src/core/unit.h index b04475e4f..81b8adbfd 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -118,6 +118,15 @@ enum UnitDependency { #include "cgroup.h" #include "cgroup-attr.h" +struct UnitRef { + /* Keeps tracks of references to a unit. This is useful so + * that we can merge two units if necessary and correct all + * references to them */ + + Unit* unit; + LIST_FIELDS(UnitRef, refs); +}; + struct Unit { Manager *manager; @@ -168,6 +177,8 @@ struct Unit { CGroupBonding *cgroup_bondings; CGroupAttribute *cgroup_attributes; + UnitRef slice; + /* Per type list */ LIST_FIELDS(Unit, units_by_type); @@ -240,15 +251,6 @@ struct Unit { bool in_audit:1; }; -struct UnitRef { - /* Keeps tracks of references to a unit. This is useful so - * that we can merge two units if necessary and correct all - * references to them */ - - Unit* unit; - LIST_FIELDS(UnitRef, refs); -}; - struct UnitStatusMessageFormats { const char *starting_stopping[2]; const char *finished_start_job[_JOB_RESULT_MAX]; @@ -265,6 +267,7 @@ struct UnitStatusMessageFormats { #include "snapshot.h" #include "swap.h" #include "path.h" +#include "slice.h" struct UnitVTable { /* How much memory does an object of this unit type need */ @@ -433,6 +436,7 @@ DEFINE_CAST(AUTOMOUNT, Automount); DEFINE_CAST(SNAPSHOT, Snapshot); DEFINE_CAST(SWAP, Swap); DEFINE_CAST(PATH, Path); +DEFINE_CAST(SLICE, Slice); Unit *unit_new(Manager *m, size_t size); void unit_free(Unit *u); @@ -474,6 +478,8 @@ int unit_load_fragment_and_dropin(Unit *u); int unit_load_fragment_and_dropin_optional(Unit *u); int unit_load(Unit *unit); +int unit_add_default_slice(Unit *u); + const char *unit_description(Unit *u) _pure_; bool unit_has_name(Unit *u, const char *name);