chiark / gitweb /
switch-root: move switch_root() call into its own .c file
[elogind.git] / src / core / manager.h
index 20b743ab35aae051d301c312b965f927f6e02d0a..046540d8964a16e5000a80fd5098ab062765f980 100644 (file)
@@ -45,6 +45,7 @@ typedef enum ManagerExitCode {
         MANAGER_POWEROFF,
         MANAGER_HALT,
         MANAGER_KEXEC,
+        MANAGER_SWITCH_ROOT,
         _MANAGER_EXIT_CODE_MAX,
         _MANAGER_EXIT_CODE_INVALID = -1
 } ManagerExitCode;
@@ -104,6 +105,9 @@ struct Manager {
          * type we maintain a per type linked list */
         LIST_HEAD(Unit, units_by_type[_UNIT_TYPE_MAX]);
 
+        /* To optimize iteration of units that have requires_mounts_for set */
+        LIST_HEAD(Unit, has_requires_mounts_for);
+
         /* Units that need to be loaded */
         LIST_HEAD(Unit, load_queue); /* this is actually more a stack than a queue, but uh. */
 
@@ -219,8 +223,6 @@ struct Manager {
 #ifdef HAVE_SYSV_COMPAT
         bool sysv_console;
 #endif
-        bool mount_auto;
-        bool swap_auto;
 
         ExecOutput default_std_output, default_std_error;
 
@@ -229,6 +231,12 @@ struct Manager {
 
         unsigned n_installed_jobs;
         unsigned n_failed_jobs;
+
+        /* Type=idle pipes */
+        int idle_pipe[2];
+
+        char *switch_root;
+        char *switch_root_init;
 };
 
 int manager_new(ManagerRunningAs running_as, Manager **m);
@@ -241,11 +249,11 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds);
 Job *manager_get_job(Manager *m, uint32_t id);
 Unit *manager_get_unit(Manager *m, const char *name);
 
-int manager_get_unit_from_dbus_path(Manager *m, const char *s, Unit **_u);
 int manager_get_job_from_dbus_path(Manager *m, const char *s, Job **_j);
 
 int manager_load_unit_prepare(Manager *m, const char *name, const char *path, DBusError *e, Unit **_ret);
 int manager_load_unit(Manager *m, const char *name, const char *path, DBusError *e, Unit **_ret);
+int manager_load_unit_from_dbus_path(Manager *m, const char *s, DBusError *e, Unit **_u);
 
 int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool force, DBusError *e, Job **_ret);
 int manager_add_job_by_name(Manager *m, JobType type, const char *name, JobMode mode, bool force, DBusError *e, Job **_ret);