chiark / gitweb /
unit: remove union Unit
authorMichal Schmidt <mschmidt@redhat.com>
Sun, 15 Jan 2012 11:04:08 +0000 (12:04 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Mon, 16 Jan 2012 12:34:42 +0000 (13:34 +0100)
Now that objects of all unit types are allocated the exact amount of
memory they need, the Unit union has lost its purpose. Remove it.

"Unit" is a more natural name for the base unit class than "Meta", so
rename Meta to Unit.

Access to members of the base class gets simplified.

44 files changed:
src/automount.c
src/automount.h
src/cgroup.c
src/dbus-automount.c
src/dbus-device.c
src/dbus-job.c
src/dbus-manager.c
src/dbus-mount.c
src/dbus-path.c
src/dbus-service.c
src/dbus-snapshot.c
src/dbus-socket.c
src/dbus-swap.c
src/dbus-timer.c
src/dbus-unit.c
src/dbus-unit.h
src/dbus.c
src/device.c
src/device.h
src/job.c
src/load-dropin.c
src/load-fragment-gperf.gperf.m4
src/load-fragment.c
src/main.c
src/manager.c
src/manager.h
src/mount.c
src/mount.h
src/path.c
src/path.h
src/service.c
src/service.h
src/snapshot.c
src/snapshot.h
src/socket.c
src/socket.h
src/swap.c
src/swap.h
src/target.c
src/target.h
src/timer.c
src/timer.h
src/unit.c
src/unit.h

index c4191f6..6858e56 100644 (file)
@@ -52,7 +52,7 @@ static void automount_init(Unit *u) {
         Automount *a = AUTOMOUNT(u);
 
         assert(u);
         Automount *a = AUTOMOUNT(u);
 
         assert(u);
-        assert(u->meta.load_state == UNIT_STUB);
+        assert(u->load_state == UNIT_STUB);
 
         a->pipe_watch.fd = a->pipe_fd = -1;
         a->pipe_watch.type = WATCH_INVALID;
 
         a->pipe_watch.fd = a->pipe_fd = -1;
         a->pipe_watch.type = WATCH_INVALID;
@@ -137,7 +137,7 @@ int automount_add_one_mount_link(Automount *a, Mount *m) {
 }
 
 static int automount_add_mount_links(Automount *a) {
 }
 
 static int automount_add_mount_links(Automount *a) {
-        Meta *other;
+        Unit *other;
         int r;
 
         assert(a);
         int r;
 
         assert(a);
@@ -198,17 +198,17 @@ static int automount_load(Unit *u) {
         Automount *a = AUTOMOUNT(u);
 
         assert(u);
         Automount *a = AUTOMOUNT(u);
 
         assert(u);
-        assert(u->meta.load_state == UNIT_STUB);
+        assert(u->load_state == UNIT_STUB);
 
         /* Load a .automount file */
         if ((r = unit_load_fragment_and_dropin_optional(u)) < 0)
                 return r;
 
 
         /* Load a .automount file */
         if ((r = unit_load_fragment_and_dropin_optional(u)) < 0)
                 return r;
 
-        if (u->meta.load_state == UNIT_LOADED) {
+        if (u->load_state == UNIT_LOADED) {
                 Unit *x;
 
                 if (!a->where)
                 Unit *x;
 
                 if (!a->where)
-                        if (!(a->where = unit_name_to_path(u->meta.id)))
+                        if (!(a->where = unit_name_to_path(u->id)))
                                 return -ENOMEM;
 
                 path_kill_slashes(a->where);
                                 return -ENOMEM;
 
                 path_kill_slashes(a->where);
@@ -263,7 +263,7 @@ static int automount_coldplug(Unit *u) {
 
         if (a->deserialized_state != a->state) {
 
 
         if (a->deserialized_state != a->state) {
 
-                if ((r = open_dev_autofs(u->meta.manager)) < 0)
+                if ((r = open_dev_autofs(u->manager)) < 0)
                         return r;
 
                 if (a->deserialized_state == AUTOMOUNT_WAITING ||
                         return r;
 
                 if (a->deserialized_state == AUTOMOUNT_WAITING ||
@@ -617,11 +617,11 @@ static int automount_start(Unit *u) {
         assert(a->state == AUTOMOUNT_DEAD || a->state == AUTOMOUNT_FAILED);
 
         if (path_is_mount_point(a->where, false)) {
         assert(a->state == AUTOMOUNT_DEAD || a->state == AUTOMOUNT_FAILED);
 
         if (path_is_mount_point(a->where, false)) {
-                log_error("Path %s is already a mount point, refusing start for %s", a->where, u->meta.id);
+                log_error("Path %s is already a mount point, refusing start for %s", a->where, u->id);
                 return -EEXIST;
         }
 
                 return -EEXIST;
         }
 
-        if (UNIT_DEREF(a->mount)->meta.load_state != UNIT_LOADED)
+        if (UNIT_DEREF(a->mount)->load_state != UNIT_LOADED)
                 return -ENOENT;
 
         a->failure = false;
                 return -ENOENT;
 
         a->failure = false;
index c6326ed..8334c97 100644 (file)
@@ -36,7 +36,7 @@ typedef enum AutomountState {
 } AutomountState;
 
 struct Automount {
 } AutomountState;
 
 struct Automount {
-        Meta meta;
+        Unit meta;
 
         AutomountState state, deserialized_state;
 
 
         AutomountState state, deserialized_state;
 
index 9680cd6..e141b41 100644 (file)
@@ -66,16 +66,16 @@ void cgroup_bonding_free(CGroupBonding *b, bool remove_or_trim) {
         if (b->unit) {
                 CGroupBonding *f;
 
         if (b->unit) {
                 CGroupBonding *f;
 
-                LIST_REMOVE(CGroupBonding, by_unit, b->unit->meta.cgroup_bondings, b);
+                LIST_REMOVE(CGroupBonding, by_unit, b->unit->cgroup_bondings, b);
 
                 if (streq(b->controller, SYSTEMD_CGROUP_CONTROLLER)) {
 
                 if (streq(b->controller, SYSTEMD_CGROUP_CONTROLLER)) {
-                        assert_se(f = hashmap_get(b->unit->meta.manager->cgroup_bondings, b->path));
+                        assert_se(f = hashmap_get(b->unit->manager->cgroup_bondings, b->path));
                         LIST_REMOVE(CGroupBonding, by_path, f, b);
 
                         if (f)
                         LIST_REMOVE(CGroupBonding, by_path, f, b);
 
                         if (f)
-                                hashmap_replace(b->unit->meta.manager->cgroup_bondings, b->path, f);
+                                hashmap_replace(b->unit->manager->cgroup_bondings, b->path, f);
                         else
                         else
-                                hashmap_remove(b->unit->meta.manager->cgroup_bondings, b->path);
+                                hashmap_remove(b->unit->manager->cgroup_bondings, b->path);
                 }
         }
 
                 }
         }
 
@@ -388,7 +388,7 @@ int cgroup_notify_empty(Manager *m, const char *group) {
 
                 if (t > 0) {
                         /* If it is empty, let's delete it */
 
                 if (t > 0) {
                         /* If it is empty, let's delete it */
-                        cgroup_bonding_trim_list(b->unit->meta.cgroup_bondings, true);
+                        cgroup_bonding_trim_list(b->unit->cgroup_bondings, true);
 
                         if (UNIT_VTABLE(b->unit)->cgroup_notify_empty)
                                 UNIT_VTABLE(b->unit)->cgroup_notify_empty(b->unit);
 
                         if (UNIT_VTABLE(b->unit)->cgroup_notify_empty)
                                 UNIT_VTABLE(b->unit)->cgroup_notify_empty(b->unit);
index 8268425..62e8a5f 100644 (file)
 const char bus_automount_interface[] _introspect_("Automount") = BUS_AUTOMOUNT_INTERFACE;
 
 DBusHandlerResult bus_automount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
 const char bus_automount_interface[] _introspect_("Automount") = BUS_AUTOMOUNT_INTERFACE;
 
 DBusHandlerResult bus_automount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
+        Automount *am = AUTOMOUNT(u);
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
-                { "org.freedesktop.systemd1.Automount", "Where", bus_property_append_string,       "s", u->automount.where           },
-                { "org.freedesktop.systemd1.Automount", "DirectoryMode", bus_property_append_mode, "u", &u->automount.directory_mode },
+                { "org.freedesktop.systemd1.Automount", "Where", bus_property_append_string,       "s", am->where           },
+                { "org.freedesktop.systemd1.Automount", "DirectoryMode", bus_property_append_mode, "u", &am->directory_mode },
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
index f85ad2d..dd5d0e9 100644 (file)
@@ -48,9 +48,10 @@ const char bus_device_invalidating_properties[] =
         "SysFSPath\0";
 
 DBusHandlerResult bus_device_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
         "SysFSPath\0";
 
 DBusHandlerResult bus_device_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
+        Device *d = DEVICE(u);
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
-                { "org.freedesktop.systemd1.Device", "SysFSPath", bus_property_append_string, "s", u->device.sysfs },
+                { "org.freedesktop.systemd1.Device", "SysFSPath", bus_property_append_string, "s", d->sysfs },
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
index 2308be3..82a23a8 100644 (file)
@@ -71,7 +71,7 @@ static int bus_job_append_unit(DBusMessageIter *i, const char *property, void *d
         if (!(p = unit_dbus_path(j->unit)))
                 return -ENOMEM;
 
         if (!(p = unit_dbus_path(j->unit)))
                 return -ENOMEM;
 
-        if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, &j->unit->meta.id) ||
+        if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, &j->unit->id) ||
             !dbus_message_iter_append_basic(&sub, DBUS_TYPE_OBJECT_PATH, &p)) {
                 free(p);
                 return -ENOMEM;
             !dbus_message_iter_append_basic(&sub, DBUS_TYPE_OBJECT_PATH, &p)) {
                 free(p);
                 return -ENOMEM;
index 7b68156..710cbcb 100644 (file)
@@ -777,39 +777,39 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
                         uint32_t job_id;
                         Unit *f;
 
                         uint32_t job_id;
                         Unit *f;
 
-                        if (k != u->meta.id)
+                        if (k != u->id)
                                 continue;
 
                         if (!dbus_message_iter_open_container(&sub, DBUS_TYPE_STRUCT, NULL, &sub2))
                                 goto oom;
 
                         description = unit_description(u);
                                 continue;
 
                         if (!dbus_message_iter_open_container(&sub, DBUS_TYPE_STRUCT, NULL, &sub2))
                                 goto oom;
 
                         description = unit_description(u);
-                        load_state = unit_load_state_to_string(u->meta.load_state);
+                        load_state = unit_load_state_to_string(u->load_state);
                         active_state = unit_active_state_to_string(unit_active_state(u));
                         sub_state = unit_sub_state_to_string(u);
 
                         f = unit_following(u);
                         active_state = unit_active_state_to_string(unit_active_state(u));
                         sub_state = unit_sub_state_to_string(u);
 
                         f = unit_following(u);
-                        following = f ? f->meta.id : "";
+                        following = f ? f->id : "";
 
                         if (!(u_path = unit_dbus_path(u)))
                                 goto oom;
 
 
                         if (!(u_path = unit_dbus_path(u)))
                                 goto oom;
 
-                        if (u->meta.job) {
-                                job_id = (uint32_t) u->meta.job->id;
+                        if (u->job) {
+                                job_id = (uint32_t) u->job->id;
 
 
-                                if (!(j_path = job_dbus_path(u->meta.job))) {
+                                if (!(j_path = job_dbus_path(u->job))) {
                                         free(u_path);
                                         goto oom;
                                 }
 
                                         free(u_path);
                                         goto oom;
                                 }
 
-                                sjob_type = job_type_to_string(u->meta.job->type);
+                                sjob_type = job_type_to_string(u->job->type);
                         } else {
                                 job_id = 0;
                                 j_path = u_path;
                                 sjob_type = "";
                         }
 
                         } else {
                                 job_id = 0;
                                 j_path = u_path;
                                 sjob_type = "";
                         }
 
-                        if (!dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &u->meta.id) ||
+                        if (!dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &u->id) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &description) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &load_state) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &active_state) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &description) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &load_state) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &active_state) ||
@@ -820,13 +820,13 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &sjob_type) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_OBJECT_PATH, &j_path)) {
                                 free(u_path);
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &sjob_type) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_OBJECT_PATH, &j_path)) {
                                 free(u_path);
-                                if (u->meta.job)
+                                if (u->job)
                                         free(j_path);
                                 goto oom;
                         }
 
                         free(u_path);
                                         free(j_path);
                                 goto oom;
                         }
 
                         free(u_path);
-                        if (u->meta.job)
+                        if (u->job)
                                 free(j_path);
 
                         if (!dbus_message_iter_close_container(&sub, &sub2))
                                 free(j_path);
 
                         if (!dbus_message_iter_close_container(&sub, &sub2))
@@ -871,7 +871,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
                         }
 
                         if (!dbus_message_iter_append_basic(&sub2, DBUS_TYPE_UINT32, &id) ||
                         }
 
                         if (!dbus_message_iter_append_basic(&sub2, DBUS_TYPE_UINT32, &id) ||
-                            !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &j->unit->meta.id) ||
+                            !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &j->unit->id) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &type) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &state) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_OBJECT_PATH, &j_path) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &type) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &state) ||
                             !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_OBJECT_PATH, &j_path) ||
@@ -1013,7 +1013,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
                 HASHMAP_FOREACH_KEY(u, k, m->units, i) {
                         char *p;
 
                 HASHMAP_FOREACH_KEY(u, k, m->units, i) {
                         char *p;
 
-                        if (k != u->meta.id)
+                        if (k != u->id)
                                 continue;
 
                         if (!(p = bus_path_escape(k))) {
                                 continue;
 
                         if (!(p = bus_path_escape(k))) {
@@ -1447,8 +1447,8 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
 
                 if (old_name)
                         if (!(u = manager_get_unit(m, old_name)) ||
 
                 if (old_name)
                         if (!(u = manager_get_unit(m, old_name)) ||
-                            !u->meta.job ||
-                            u->meta.job->type != JOB_START) {
+                            !u->job ||
+                            u->job->type != JOB_START) {
                                 dbus_set_error(&error, BUS_ERROR_NO_SUCH_JOB, "No job queued for unit %s", old_name);
                                 return bus_send_error_reply(connection, message, &error, -ENOENT);
                         }
                                 dbus_set_error(&error, BUS_ERROR_NO_SUCH_JOB, "No job queued for unit %s", old_name);
                                 return bus_send_error_reply(connection, message, &error, -ENOENT);
                         }
@@ -1469,10 +1469,10 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
                                 job_type = JOB_RELOAD;
                 }
 
                                 job_type = JOB_RELOAD;
                 }
 
-                if ((job_type == JOB_START && u->meta.refuse_manual_start) ||
-                    (job_type == JOB_STOP && u->meta.refuse_manual_stop) ||
+                if ((job_type == JOB_START && u->refuse_manual_start) ||
+                    (job_type == JOB_STOP && u->refuse_manual_stop) ||
                     ((job_type == JOB_RESTART || job_type == JOB_TRY_RESTART) &&
                     ((job_type == JOB_RESTART || job_type == JOB_TRY_RESTART) &&
-                     (u->meta.refuse_manual_start || u->meta.refuse_manual_stop))) {
+                     (u->refuse_manual_start || u->refuse_manual_stop))) {
                         dbus_set_error(&error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, may be requested by dependency only.");
                         return bus_send_error_reply(connection, message, &error, -EPERM);
                 }
                         dbus_set_error(&error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, may be requested by dependency only.");
                         return bus_send_error_reply(connection, message, &error, -EPERM);
                 }
index cfbfd45..60f1e92 100644 (file)
@@ -136,20 +136,20 @@ static int bus_mount_append_type(DBusMessageIter *i, const char *property, void
 }
 
 DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
 }
 
 DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
-
+        Mount *m = MOUNT(u);
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
-                { "org.freedesktop.systemd1.Mount", "Where",         bus_property_append_string, "s", u->mount.where           },
+                { "org.freedesktop.systemd1.Mount", "Where",         bus_property_append_string, "s", m->where                 },
                 { "org.freedesktop.systemd1.Mount", "What",          bus_mount_append_what,      "s", u                        },
                 { "org.freedesktop.systemd1.Mount", "Options",       bus_mount_append_options,   "s", u                        },
                 { "org.freedesktop.systemd1.Mount", "Type",          bus_mount_append_type,      "s", u                        },
                 { "org.freedesktop.systemd1.Mount", "What",          bus_mount_append_what,      "s", u                        },
                 { "org.freedesktop.systemd1.Mount", "Options",       bus_mount_append_options,   "s", u                        },
                 { "org.freedesktop.systemd1.Mount", "Type",          bus_mount_append_type,      "s", u                        },
-                { "org.freedesktop.systemd1.Mount", "TimeoutUSec",   bus_property_append_usec,   "t", &u->mount.timeout_usec   },
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Mount", u->mount.exec_command+MOUNT_EXEC_MOUNT,   "ExecMount"),
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Mount", u->mount.exec_command+MOUNT_EXEC_UNMOUNT, "ExecUnmount"),
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Mount", u->mount.exec_command+MOUNT_EXEC_REMOUNT, "ExecRemount"),
-                BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Mount", u->mount.exec_context),
-                { "org.freedesktop.systemd1.Mount", "ControlPID",    bus_property_append_pid,    "u", &u->mount.control_pid    },
-                { "org.freedesktop.systemd1.Mount", "DirectoryMode", bus_property_append_mode,   "u", &u->mount.directory_mode },
+                { "org.freedesktop.systemd1.Mount", "TimeoutUSec",   bus_property_append_usec,   "t", &m->timeout_usec         },
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Mount", m->exec_command+MOUNT_EXEC_MOUNT,   "ExecMount"),
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Mount", m->exec_command+MOUNT_EXEC_UNMOUNT, "ExecUnmount"),
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Mount", m->exec_command+MOUNT_EXEC_REMOUNT, "ExecRemount"),
+                BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Mount", m->exec_context),
+                { "org.freedesktop.systemd1.Mount", "ControlPID",    bus_property_append_pid,    "u", &m->control_pid          },
+                { "org.freedesktop.systemd1.Mount", "DirectoryMode", bus_property_append_mode,   "u", &m->directory_mode       },
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
index f67b5a2..53a5b42 100644 (file)
@@ -80,24 +80,26 @@ static int bus_path_append_paths(DBusMessageIter *i, const char *property, void
 
 static int bus_path_append_unit(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
 
 static int bus_path_append_unit(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
+        Path *p = PATH(u);
         const char *t;
 
         assert(i);
         assert(property);
         assert(u);
 
         const char *t;
 
         assert(i);
         assert(property);
         assert(u);
 
-        t = UNIT_DEREF(u->path.unit) ? UNIT_DEREF(u->path.unit)->meta.id : "";
+        t = UNIT_DEREF(p->unit) ? UNIT_DEREF(p->unit)->id : "";
 
         return dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t) ? 0 : -ENOMEM;
 }
 
 DBusHandlerResult bus_path_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
 
         return dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t) ? 0 : -ENOMEM;
 }
 
 DBusHandlerResult bus_path_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
+        Path *p = PATH(u);
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
-                { "org.freedesktop.systemd1.Path", "Unit",          bus_path_append_unit,     "s",     u                        },
-                { "org.freedesktop.systemd1.Path", "Paths",         bus_path_append_paths,    "a(ss)", u                        },
-                { "org.freedesktop.systemd1.Path", "MakeDirectory", bus_property_append_bool, "b",     &u->path.make_directory  },
-                { "org.freedesktop.systemd1.Path", "DirectoryMode", bus_property_append_mode, "u",     &u->path.directory_mode  },
+                { "org.freedesktop.systemd1.Path", "Unit",          bus_path_append_unit,     "s",     u                   },
+                { "org.freedesktop.systemd1.Path", "Paths",         bus_path_append_paths,    "a(ss)", u                   },
+                { "org.freedesktop.systemd1.Path", "MakeDirectory", bus_property_append_bool, "b",     &p->make_directory  },
+                { "org.freedesktop.systemd1.Path", "DirectoryMode", bus_property_append_mode, "u",     &p->directory_mode  },
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
index 373e3f5..2157c2b 100644 (file)
@@ -95,36 +95,37 @@ static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_service_append_restart, service_resta
 static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_service_append_notify_access, notify_access, NotifyAccess);
 
 DBusHandlerResult bus_service_message_handler(Unit *u, DBusConnection *connection, DBusMessage *message) {
 static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_service_append_notify_access, notify_access, NotifyAccess);
 
 DBusHandlerResult bus_service_message_handler(Unit *u, DBusConnection *connection, DBusMessage *message) {
+        Service *s = SERVICE(u);
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
-                { "org.freedesktop.systemd1.Service", "Type",                   bus_service_append_type,    "s", &u->service.type                      },
-                { "org.freedesktop.systemd1.Service", "Restart",                bus_service_append_restart, "s", &u->service.restart                   },
-                { "org.freedesktop.systemd1.Service", "PIDFile",                bus_property_append_string, "s", u->service.pid_file                   },
-                { "org.freedesktop.systemd1.Service", "NotifyAccess",           bus_service_append_notify_access, "s", &u->service.notify_access       },
-                { "org.freedesktop.systemd1.Service", "RestartUSec",            bus_property_append_usec,   "t", &u->service.restart_usec              },
-                { "org.freedesktop.systemd1.Service", "TimeoutUSec",            bus_property_append_usec,   "t", &u->service.timeout_usec              },
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", u->service.exec_command[SERVICE_EXEC_START_PRE],  "ExecStartPre"),
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", u->service.exec_command[SERVICE_EXEC_START],      "ExecStart"),
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", u->service.exec_command[SERVICE_EXEC_START_POST], "ExecStartPost"),
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", u->service.exec_command[SERVICE_EXEC_RELOAD],     "ExecReload"),
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", u->service.exec_command[SERVICE_EXEC_STOP],       "ExecStop"),
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", u->service.exec_command[SERVICE_EXEC_STOP_POST],  "ExecStopPost"),
-                BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Service", u->service.exec_context),
-                { "org.freedesktop.systemd1.Service", "PermissionsStartOnly",   bus_property_append_bool,   "b", &u->service.permissions_start_only    },
-                { "org.freedesktop.systemd1.Service", "RootDirectoryStartOnly", bus_property_append_bool,   "b", &u->service.root_directory_start_only },
-                { "org.freedesktop.systemd1.Service", "RemainAfterExit",        bus_property_append_bool,   "b", &u->service.remain_after_exit         },
-                { "org.freedesktop.systemd1.Service", "GuessMainPID",           bus_property_append_bool,   "b", &u->service.guess_main_pid            },
-               BUS_EXEC_STATUS_PROPERTIES("org.freedesktop.systemd1.Service", u->service.main_exec_status, "ExecMain"),
-                { "org.freedesktop.systemd1.Service", "MainPID",                bus_property_append_pid,    "u", &u->service.main_pid                  },
-                { "org.freedesktop.systemd1.Service", "ControlPID",             bus_property_append_pid,    "u", &u->service.control_pid               },
-                { "org.freedesktop.systemd1.Service", "BusName",                bus_property_append_string, "s", u->service.bus_name                   },
-                { "org.freedesktop.systemd1.Service", "StatusText",             bus_property_append_string, "s", u->service.status_text                },
+                { "org.freedesktop.systemd1.Service", "Type",                   bus_service_append_type,    "s", &s->type                      },
+                { "org.freedesktop.systemd1.Service", "Restart",                bus_service_append_restart, "s", &s->restart                   },
+                { "org.freedesktop.systemd1.Service", "PIDFile",                bus_property_append_string, "s", s->pid_file                   },
+                { "org.freedesktop.systemd1.Service", "NotifyAccess",           bus_service_append_notify_access, "s", &s->notify_access       },
+                { "org.freedesktop.systemd1.Service", "RestartUSec",            bus_property_append_usec,   "t", &s->restart_usec              },
+                { "org.freedesktop.systemd1.Service", "TimeoutUSec",            bus_property_append_usec,   "t", &s->timeout_usec              },
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", s->exec_command[SERVICE_EXEC_START_PRE],  "ExecStartPre"),
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", s->exec_command[SERVICE_EXEC_START],      "ExecStart"),
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", s->exec_command[SERVICE_EXEC_START_POST], "ExecStartPost"),
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", s->exec_command[SERVICE_EXEC_RELOAD],     "ExecReload"),
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", s->exec_command[SERVICE_EXEC_STOP],       "ExecStop"),
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Service", s->exec_command[SERVICE_EXEC_STOP_POST],  "ExecStopPost"),
+                BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Service", s->exec_context),
+                { "org.freedesktop.systemd1.Service", "PermissionsStartOnly",   bus_property_append_bool,   "b", &s->permissions_start_only    },
+                { "org.freedesktop.systemd1.Service", "RootDirectoryStartOnly", bus_property_append_bool,   "b", &s->root_directory_start_only },
+                { "org.freedesktop.systemd1.Service", "RemainAfterExit",        bus_property_append_bool,   "b", &s->remain_after_exit         },
+                { "org.freedesktop.systemd1.Service", "GuessMainPID",           bus_property_append_bool,   "b", &s->guess_main_pid            },
+               BUS_EXEC_STATUS_PROPERTIES("org.freedesktop.systemd1.Service", s->main_exec_status, "ExecMain"),
+                { "org.freedesktop.systemd1.Service", "MainPID",                bus_property_append_pid,    "u", &s->main_pid                  },
+                { "org.freedesktop.systemd1.Service", "ControlPID",             bus_property_append_pid,    "u", &s->control_pid               },
+                { "org.freedesktop.systemd1.Service", "BusName",                bus_property_append_string, "s", s->bus_name                   },
+                { "org.freedesktop.systemd1.Service", "StatusText",             bus_property_append_string, "s", s->status_text                },
 #ifdef HAVE_SYSV_COMPAT
 #ifdef HAVE_SYSV_COMPAT
-                { "org.freedesktop.systemd1.Service", "SysVRunLevels",          bus_property_append_string, "s", u->service.sysv_runlevels             },
-                { "org.freedesktop.systemd1.Service", "SysVStartPriority",      bus_property_append_int,    "i", &u->service.sysv_start_priority       },
-                { "org.freedesktop.systemd1.Service", "SysVPath",               bus_property_append_string, "s", u->service.sysv_path                  },
+                { "org.freedesktop.systemd1.Service", "SysVRunLevels",          bus_property_append_string, "s", s->sysv_runlevels             },
+                { "org.freedesktop.systemd1.Service", "SysVStartPriority",      bus_property_append_int,    "i", &s->sysv_start_priority       },
+                { "org.freedesktop.systemd1.Service", "SysVPath",               bus_property_append_string, "s", s->sysv_path                  },
 #endif
 #endif
-                { "org.freedesktop.systemd1.Service", "FsckPassNo",             bus_property_append_int,    "i", &u->service.fsck_passno               },
+                { "org.freedesktop.systemd1.Service", "FsckPassNo",             bus_property_append_int,    "i", &s->fsck_passno               },
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
index 0c2f349..0967034 100644 (file)
 const char bus_snapshot_interface[] _introspect_("Snapshot") = BUS_SNAPSHOT_INTERFACE;
 
 DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
 const char bus_snapshot_interface[] _introspect_("Snapshot") = BUS_SNAPSHOT_INTERFACE;
 
 DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
-
+        Snapshot *s = SNAPSHOT(u);
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
-                { "org.freedesktop.systemd1.Snapshot", "Cleanup", bus_property_append_bool, "b", &u->snapshot.cleanup },
+                { "org.freedesktop.systemd1.Snapshot", "Cleanup", bus_property_append_bool, "b", &s->cleanup },
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
index c428189..9caed55 100644 (file)
@@ -88,39 +88,39 @@ const char bus_socket_invalidating_properties[] =
 static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_socket_append_bind_ipv6_only, socket_address_bind_ipv6_only, SocketAddressBindIPv6Only);
 
 DBusHandlerResult bus_socket_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
 static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_socket_append_bind_ipv6_only, socket_address_bind_ipv6_only, SocketAddressBindIPv6Only);
 
 DBusHandlerResult bus_socket_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
-
+        Socket *s = SOCKET(u);
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
-                { "org.freedesktop.systemd1.Socket", "BindIPv6Only",   bus_socket_append_bind_ipv6_only, "s", &u->socket.bind_ipv6_only  },
-                { "org.freedesktop.systemd1.Socket", "Backlog",        bus_property_append_unsigned,     "u", &u->socket.backlog         },
-                { "org.freedesktop.systemd1.Socket", "TimeoutUSec",    bus_property_append_usec,         "t", &u->socket.timeout_usec    },
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Socket", u->service.exec_command[SOCKET_EXEC_START_PRE],  "ExecStartPre"),
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Socket", u->service.exec_command[SOCKET_EXEC_START_POST], "ExecStartPost"),
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Socket", u->service.exec_command[SOCKET_EXEC_STOP_PRE],   "ExecStopPre"),
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Socket", u->service.exec_command[SOCKET_EXEC_STOP_POST],  "ExecStopPost"),
-                BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Socket", u->socket.exec_context),
-                { "org.freedesktop.systemd1.Socket", "ControlPID",     bus_property_append_pid,          "u", &u->socket.control_pid     },
-                { "org.freedesktop.systemd1.Socket", "BindToDevice",   bus_property_append_string,       "s", u->socket.bind_to_device   },
-                { "org.freedesktop.systemd1.Socket", "DirectoryMode",  bus_property_append_mode,         "u", &u->socket.directory_mode  },
-                { "org.freedesktop.systemd1.Socket", "SocketMode",     bus_property_append_mode,         "u", &u->socket.socket_mode     },
-                { "org.freedesktop.systemd1.Socket", "Accept",         bus_property_append_bool,         "b", &u->socket.accept          },
-                { "org.freedesktop.systemd1.Socket", "KeepAlive",      bus_property_append_bool,         "b", &u->socket.keep_alive      },
-                { "org.freedesktop.systemd1.Socket", "Priority",       bus_property_append_int,          "i", &u->socket.priority        },
-                { "org.freedesktop.systemd1.Socket", "ReceiveBuffer",  bus_property_append_size,         "t", &u->socket.receive_buffer  },
-                { "org.freedesktop.systemd1.Socket", "SendBuffer",     bus_property_append_size,         "t", &u->socket.send_buffer     },
-                { "org.freedesktop.systemd1.Socket", "IPTOS",          bus_property_append_int,          "i", &u->socket.ip_tos          },
-                { "org.freedesktop.systemd1.Socket", "IPTTL",          bus_property_append_int,          "i", &u->socket.ip_ttl          },
-                { "org.freedesktop.systemd1.Socket", "PipeSize",       bus_property_append_size,         "t", &u->socket.pipe_size       },
-                { "org.freedesktop.systemd1.Socket", "FreeBind",       bus_property_append_bool,         "b", &u->socket.free_bind       },
-                { "org.freedesktop.systemd1.Socket", "Transparent",    bus_property_append_bool,         "b", &u->socket.transparent     },
-                { "org.freedesktop.systemd1.Socket", "Broadcast",      bus_property_append_bool,         "b", &u->socket.broadcast       },
-                { "org.freedesktop.systemd1.Socket", "PassCredentials",bus_property_append_bool,         "b", &u->socket.pass_cred       },
-                { "org.freedesktop.systemd1.Socket", "Mark",           bus_property_append_int,          "i", &u->socket.mark            },
-                { "org.freedesktop.systemd1.Socket", "MaxConnections", bus_property_append_unsigned,     "u", &u->socket.max_connections },
-                { "org.freedesktop.systemd1.Socket", "NConnections",   bus_property_append_unsigned,     "u", &u->socket.n_connections   },
-                { "org.freedesktop.systemd1.Socket", "NAccepted",      bus_property_append_unsigned,     "u", &u->socket.n_accepted      },
-                { "org.freedesktop.systemd1.Socket", "MessageQueueMaxMessages", bus_property_append_long,"x", &u->socket.mq_maxmsg       },
-                { "org.freedesktop.systemd1.Socket", "MessageQueueMessageSize", bus_property_append_long,"x", &u->socket.mq_msgsize      },
+                { "org.freedesktop.systemd1.Socket", "BindIPv6Only",   bus_socket_append_bind_ipv6_only, "s", &s->bind_ipv6_only  },
+                { "org.freedesktop.systemd1.Socket", "Backlog",        bus_property_append_unsigned,     "u", &s->backlog         },
+                { "org.freedesktop.systemd1.Socket", "TimeoutUSec",    bus_property_append_usec,         "t", &s->timeout_usec    },
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Socket", s->exec_command[SOCKET_EXEC_START_PRE],  "ExecStartPre"),
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Socket", s->exec_command[SOCKET_EXEC_START_POST], "ExecStartPost"),
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Socket", s->exec_command[SOCKET_EXEC_STOP_PRE],   "ExecStopPre"),
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Socket", s->exec_command[SOCKET_EXEC_STOP_POST],  "ExecStopPost"),
+                BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Socket", s->exec_context),
+                { "org.freedesktop.systemd1.Socket", "ControlPID",     bus_property_append_pid,          "u", &s->control_pid     },
+                { "org.freedesktop.systemd1.Socket", "BindToDevice",   bus_property_append_string,       "s", s->bind_to_device   },
+                { "org.freedesktop.systemd1.Socket", "DirectoryMode",  bus_property_append_mode,         "u", &s->directory_mode  },
+                { "org.freedesktop.systemd1.Socket", "SocketMode",     bus_property_append_mode,         "u", &s->socket_mode     },
+                { "org.freedesktop.systemd1.Socket", "Accept",         bus_property_append_bool,         "b", &s->accept          },
+                { "org.freedesktop.systemd1.Socket", "KeepAlive",      bus_property_append_bool,         "b", &s->keep_alive      },
+                { "org.freedesktop.systemd1.Socket", "Priority",       bus_property_append_int,          "i", &s->priority        },
+                { "org.freedesktop.systemd1.Socket", "ReceiveBuffer",  bus_property_append_size,         "t", &s->receive_buffer  },
+                { "org.freedesktop.systemd1.Socket", "SendBuffer",     bus_property_append_size,         "t", &s->send_buffer     },
+                { "org.freedesktop.systemd1.Socket", "IPTOS",          bus_property_append_int,          "i", &s->ip_tos          },
+                { "org.freedesktop.systemd1.Socket", "IPTTL",          bus_property_append_int,          "i", &s->ip_ttl          },
+                { "org.freedesktop.systemd1.Socket", "PipeSize",       bus_property_append_size,         "t", &s->pipe_size       },
+                { "org.freedesktop.systemd1.Socket", "FreeBind",       bus_property_append_bool,         "b", &s->free_bind       },
+                { "org.freedesktop.systemd1.Socket", "Transparent",    bus_property_append_bool,         "b", &s->transparent     },
+                { "org.freedesktop.systemd1.Socket", "Broadcast",      bus_property_append_bool,         "b", &s->broadcast       },
+                { "org.freedesktop.systemd1.Socket", "PassCredentials",bus_property_append_bool,         "b", &s->pass_cred       },
+                { "org.freedesktop.systemd1.Socket", "Mark",           bus_property_append_int,          "i", &s->mark            },
+                { "org.freedesktop.systemd1.Socket", "MaxConnections", bus_property_append_unsigned,     "u", &s->max_connections },
+                { "org.freedesktop.systemd1.Socket", "NConnections",   bus_property_append_unsigned,     "u", &s->n_connections   },
+                { "org.freedesktop.systemd1.Socket", "NAccepted",      bus_property_append_unsigned,     "u", &s->n_accepted      },
+                { "org.freedesktop.systemd1.Socket", "MessageQueueMaxMessages", bus_property_append_long,"x", &s->mq_maxmsg       },
+                { "org.freedesktop.systemd1.Socket", "MessageQueueMessageSize", bus_property_append_long,"x", &s->mq_msgsize      },
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
index 988ca58..3002581 100644 (file)
@@ -85,14 +85,15 @@ static int bus_swap_append_priority(DBusMessageIter *i, const char *property, vo
 }
 
 DBusHandlerResult bus_swap_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
 }
 
 DBusHandlerResult bus_swap_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
+        Swap *s = SWAP(u);
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
-                { "org.freedesktop.systemd1.Swap", "What",       bus_property_append_string, "s", u->swap.what          },
-                { "org.freedesktop.systemd1.Swap", "Priority",   bus_swap_append_priority,   "i", u                     },
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Swap", u->swap.exec_command+SWAP_EXEC_ACTIVATE,   "ExecActivate"),
-                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Swap", u->swap.exec_command+SWAP_EXEC_DEACTIVATE, "ExecDeactivate"),
-                BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Swap", u->swap.exec_context),
-                { "org.freedesktop.systemd1.Swap", "ControlPID", bus_property_append_pid,    "u", &u->swap.control_pid },
+                { "org.freedesktop.systemd1.Swap", "What",       bus_property_append_string, "s", s->what         },
+                { "org.freedesktop.systemd1.Swap", "Priority",   bus_swap_append_priority,   "i", u               },
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Swap", s->exec_command+SWAP_EXEC_ACTIVATE,   "ExecActivate"),
+                BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Swap", s->exec_command+SWAP_EXEC_DEACTIVATE, "ExecDeactivate"),
+                BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Swap", s->exec_context),
+                { "org.freedesktop.systemd1.Swap", "ControlPID", bus_property_append_pid,    "u", &s->control_pid },
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
index 07d425e..0c4b4f3 100644 (file)
@@ -101,23 +101,25 @@ static int bus_timer_append_timers(DBusMessageIter *i, const char *property, voi
 
 static int bus_timer_append_unit(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
 
 static int bus_timer_append_unit(DBusMessageIter *i, const char *property, void *data) {
         Unit *u = data;
+        Timer *timer = TIMER(u);
         const char *t;
 
         assert(i);
         assert(property);
         assert(u);
 
         const char *t;
 
         assert(i);
         assert(property);
         assert(u);
 
-        t = UNIT_DEREF(u->timer.unit) ? UNIT_DEREF(u->timer.unit)->meta.id : "";
+        t = UNIT_DEREF(timer->unit) ? UNIT_DEREF(timer->unit)->id : "";
 
         return dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t) ? 0 : -ENOMEM;
 }
 
 DBusHandlerResult bus_timer_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
 
         return dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t) ? 0 : -ENOMEM;
 }
 
 DBusHandlerResult bus_timer_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
+        Timer *t = TIMER(u);
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
         const BusProperty properties[] = {
                 BUS_UNIT_PROPERTIES,
-                { "org.freedesktop.systemd1.Timer", "Unit",           bus_timer_append_unit,      "s",      u                      },
-                { "org.freedesktop.systemd1.Timer", "Timers",         bus_timer_append_timers,    "a(stt)", u                      },
-                { "org.freedesktop.systemd1.Timer", "NextElapseUSec", bus_property_append_usec,   "t",      &u->timer.next_elapse  },
+                { "org.freedesktop.systemd1.Timer", "Unit",           bus_timer_append_unit,      "s",      u               },
+                { "org.freedesktop.systemd1.Timer", "Timers",         bus_timer_append_timers,    "a(stt)", u               },
+                { "org.freedesktop.systemd1.Timer", "NextElapseUSec", bus_property_append_usec,   "t",      &t->next_elapse },
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
                 { NULL, NULL, NULL, NULL, NULL }
         };
 
index 611a120..dc5321e 100644 (file)
@@ -49,7 +49,7 @@ int bus_unit_append_names(DBusMessageIter *i, const char *property, void *data)
         if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "s", &sub))
                 return -ENOMEM;
 
         if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "s", &sub))
                 return -ENOMEM;
 
-        SET_FOREACH(t, u->meta.names, j)
+        SET_FOREACH(t, u->names, j)
                 if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, &t))
                         return -ENOMEM;
 
                 if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, &t))
                         return -ENOMEM;
 
@@ -68,7 +68,7 @@ int bus_unit_append_following(DBusMessageIter *i, const char *property, void *da
         assert(u);
 
         f = unit_following(u);
         assert(u);
 
         f = unit_following(u);
-        d = f ? f->meta.id : "";
+        d = f ? f->id : "";
 
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &d))
                 return -ENOMEM;
 
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &d))
                 return -ENOMEM;
@@ -86,7 +86,7 @@ int bus_unit_append_dependencies(DBusMessageIter *i, const char *property, void
                 return -ENOMEM;
 
         SET_FOREACH(u, s, j)
                 return -ENOMEM;
 
         SET_FOREACH(u, s, j)
-                if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, &u->meta.id))
+                if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, &u->id))
                         return -ENOMEM;
 
         if (!dbus_message_iter_close_container(i, &sub))
                         return -ENOMEM;
 
         if (!dbus_message_iter_close_container(i, &sub))
@@ -170,7 +170,7 @@ int bus_unit_append_can_start(DBusMessageIter *i, const char *property, void *da
         assert(u);
 
         b = unit_can_start(u) &&
         assert(u);
 
         b = unit_can_start(u) &&
-                !u->meta.refuse_manual_start;
+                !u->refuse_manual_start;
 
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
                 return -ENOMEM;
 
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
                 return -ENOMEM;
@@ -190,7 +190,7 @@ int bus_unit_append_can_stop(DBusMessageIter *i, const char *property, void *dat
          * we can also stop */
 
         b = unit_can_start(u) &&
          * we can also stop */
 
         b = unit_can_start(u) &&
-                !u->meta.refuse_manual_stop;
+                !u->refuse_manual_stop;
 
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
                 return -ENOMEM;
 
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
                 return -ENOMEM;
@@ -223,7 +223,7 @@ int bus_unit_append_can_isolate(DBusMessageIter *i, const char *property, void *
         assert(u);
 
         b = unit_can_isolate(u) &&
         assert(u);
 
         b = unit_can_isolate(u) &&
-                !u->meta.refuse_manual_start;
+                !u->refuse_manual_start;
 
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
                 return -ENOMEM;
 
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
                 return -ENOMEM;
@@ -243,12 +243,12 @@ int bus_unit_append_job(DBusMessageIter *i, const char *property, void *data) {
         if (!dbus_message_iter_open_container(i, DBUS_TYPE_STRUCT, NULL, &sub))
                 return -ENOMEM;
 
         if (!dbus_message_iter_open_container(i, DBUS_TYPE_STRUCT, NULL, &sub))
                 return -ENOMEM;
 
-        if (u->meta.job) {
+        if (u->job) {
 
 
-                if (!(p = job_dbus_path(u->meta.job)))
+                if (!(p = job_dbus_path(u->job)))
                         return -ENOMEM;
 
                         return -ENOMEM;
 
-                if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_UINT32, &u->meta.job->id) ||
+                if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_UINT32, &u->job->id) ||
                     !dbus_message_iter_append_basic(&sub, DBUS_TYPE_OBJECT_PATH, &p)) {
                         free(p);
                         return -ENOMEM;
                     !dbus_message_iter_append_basic(&sub, DBUS_TYPE_OBJECT_PATH, &p)) {
                         free(p);
                         return -ENOMEM;
@@ -310,7 +310,7 @@ int bus_unit_append_cgroups(DBusMessageIter *i, const char *property, void *data
         if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "s", &sub))
                 return -ENOMEM;
 
         if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "s", &sub))
                 return -ENOMEM;
 
-        LIST_FOREACH(by_unit, cgb, u->meta.cgroup_bondings) {
+        LIST_FOREACH(by_unit, cgb, u->cgroup_bondings) {
                 char *t;
                 bool success;
 
                 char *t;
                 bool success;
 
@@ -338,7 +338,7 @@ int bus_unit_append_cgroup_attrs(DBusMessageIter *i, const char *property, void
         if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "(sss)", &sub))
                 return -ENOMEM;
 
         if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "(sss)", &sub))
                 return -ENOMEM;
 
-        LIST_FOREACH(by_unit, a, u->meta.cgroup_attributes) {
+        LIST_FOREACH(by_unit, a, u->cgroup_attributes) {
                 char *v = NULL;
                 bool success;
 
                 char *v = NULL;
                 bool success;
 
@@ -389,9 +389,9 @@ int bus_unit_append_load_error(DBusMessageIter *i, const char *property, void *d
         assert(property);
         assert(u);
 
         assert(property);
         assert(u);
 
-        if (u->meta.load_error != 0) {
-                name = bus_errno_to_dbus(u->meta.load_error);
-                message = strempty(strerror(-u->meta.load_error));
+        if (u->load_error != 0) {
+                name = bus_errno_to_dbus(u->load_error);
+                message = strempty(strerror(-u->load_error));
         } else
                 name = message = "";
 
         } else
                 name = message = "";
 
@@ -406,7 +406,7 @@ int bus_unit_append_load_error(DBusMessageIter *i, const char *property, void *d
 
 static DBusHandlerResult bus_unit_message_dispatch(Unit *u, DBusConnection *connection, DBusMessage *message) {
         DBusMessage *reply = NULL;
 
 static DBusHandlerResult bus_unit_message_dispatch(Unit *u, DBusConnection *connection, DBusMessage *message) {
         DBusMessage *reply = NULL;
-        Manager *m = u->meta.manager;
+        Manager *m = u->manager;
         DBusError error;
         JobType job_type = _JOB_TYPE_INVALID;
         char *path = NULL;
         DBusError error;
         JobType job_type = _JOB_TYPE_INVALID;
         char *path = NULL;
@@ -489,10 +489,10 @@ static DBusHandlerResult bus_unit_message_dispatch(Unit *u, DBusConnection *conn
                 Job *j;
                 int r;
 
                 Job *j;
                 int r;
 
-                if ((job_type == JOB_START && u->meta.refuse_manual_start) ||
-                    (job_type == JOB_STOP && u->meta.refuse_manual_stop) ||
+                if ((job_type == JOB_START && u->refuse_manual_start) ||
+                    (job_type == JOB_STOP && u->refuse_manual_stop) ||
                     ((job_type == JOB_RESTART || job_type == JOB_TRY_RESTART) &&
                     ((job_type == JOB_RESTART || job_type == JOB_TRY_RESTART) &&
-                     (u->meta.refuse_manual_start || u->meta.refuse_manual_stop))) {
+                     (u->refuse_manual_start || u->refuse_manual_stop))) {
                         dbus_set_error(&error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, may be requested by dependency only.");
                         return bus_send_error_reply(connection, message, &error, -EPERM);
                 }
                         dbus_set_error(&error, BUS_ERROR_ONLY_BY_DEPENDENCY, "Operation refused, may be requested by dependency only.");
                         return bus_send_error_reply(connection, message, &error, -EPERM);
                 }
@@ -594,7 +594,7 @@ static DBusHandlerResult bus_unit_message_handler(DBusConnection *connection, DB
                         HASHMAP_FOREACH_KEY(u, k, m->units, i) {
                                 char *p;
 
                         HASHMAP_FOREACH_KEY(u, k, m->units, i) {
                                 char *p;
 
-                                if (k != u->meta.id)
+                                if (k != u->id)
                                         continue;
 
                                 if (!(p = bus_path_escape(k))) {
                                         continue;
 
                                 if (!(p = bus_path_escape(k))) {
@@ -673,23 +673,23 @@ void bus_unit_send_change_signal(Unit *u) {
 
         assert(u);
 
 
         assert(u);
 
-        if (u->meta.in_dbus_queue) {
-                LIST_REMOVE(Meta, dbus_queue, u->meta.manager->dbus_unit_queue, &u->meta);
-                u->meta.in_dbus_queue = false;
+        if (u->in_dbus_queue) {
+                LIST_REMOVE(Unit, dbus_queue, u->manager->dbus_unit_queue, u);
+                u->in_dbus_queue = false;
         }
 
         }
 
-        if (!u->meta.id)
+        if (!u->id)
                 return;
 
                 return;
 
-        if (!bus_has_subscriber(u->meta.manager)) {
-                u->meta.sent_dbus_new_signal = true;
+        if (!bus_has_subscriber(u->manager)) {
+                u->sent_dbus_new_signal = true;
                 return;
         }
 
         if (!(p = unit_dbus_path(u)))
                 goto oom;
 
                 return;
         }
 
         if (!(p = unit_dbus_path(u)))
                 goto oom;
 
-        if (u->meta.sent_dbus_new_signal) {
+        if (u->sent_dbus_new_signal) {
                 /* Send a properties changed signal. First for the
                  * specific type, then for the generic unit. The
                  * clients may rely on this order to get atomic
                 /* Send a properties changed signal. First for the
                  * specific type, then for the generic unit. The
                  * clients may rely on this order to get atomic
@@ -702,7 +702,7 @@ void bus_unit_send_change_signal(Unit *u) {
                                                              UNIT_VTABLE(u)->bus_invalidating_properties)))
                                 goto oom;
 
                                                              UNIT_VTABLE(u)->bus_invalidating_properties)))
                                 goto oom;
 
-                        if (bus_broadcast(u->meta.manager, m) < 0)
+                        if (bus_broadcast(u->manager, m) < 0)
                                 goto oom;
 
                         dbus_message_unref(m);
                                 goto oom;
 
                         dbus_message_unref(m);
@@ -718,19 +718,19 @@ void bus_unit_send_change_signal(Unit *u) {
                         goto oom;
 
                 if (!dbus_message_append_args(m,
                         goto oom;
 
                 if (!dbus_message_append_args(m,
-                                              DBUS_TYPE_STRING, &u->meta.id,
+                                              DBUS_TYPE_STRING, &u->id,
                                               DBUS_TYPE_OBJECT_PATH, &p,
                                               DBUS_TYPE_INVALID))
                         goto oom;
         }
 
                                               DBUS_TYPE_OBJECT_PATH, &p,
                                               DBUS_TYPE_INVALID))
                         goto oom;
         }
 
-        if (bus_broadcast(u->meta.manager, m) < 0)
+        if (bus_broadcast(u->manager, m) < 0)
                 goto oom;
 
         free(p);
         dbus_message_unref(m);
 
                 goto oom;
 
         free(p);
         dbus_message_unref(m);
 
-        u->meta.sent_dbus_new_signal = true;
+        u->sent_dbus_new_signal = true;
 
         return;
 
 
         return;
 
@@ -749,13 +749,13 @@ void bus_unit_send_removed_signal(Unit *u) {
 
         assert(u);
 
 
         assert(u);
 
-        if (!bus_has_subscriber(u->meta.manager))
+        if (!bus_has_subscriber(u->manager))
                 return;
 
                 return;
 
-        if (!u->meta.sent_dbus_new_signal)
+        if (!u->sent_dbus_new_signal)
                 bus_unit_send_change_signal(u);
 
                 bus_unit_send_change_signal(u);
 
-        if (!u->meta.id)
+        if (!u->id)
                 return;
 
         if (!(p = unit_dbus_path(u)))
                 return;
 
         if (!(p = unit_dbus_path(u)))
@@ -765,12 +765,12 @@ void bus_unit_send_removed_signal(Unit *u) {
                 goto oom;
 
         if (!dbus_message_append_args(m,
                 goto oom;
 
         if (!dbus_message_append_args(m,
-                                      DBUS_TYPE_STRING, &u->meta.id,
+                                      DBUS_TYPE_STRING, &u->id,
                                       DBUS_TYPE_OBJECT_PATH, &p,
                                       DBUS_TYPE_INVALID))
                 goto oom;
 
                                       DBUS_TYPE_OBJECT_PATH, &p,
                                       DBUS_TYPE_INVALID))
                 goto oom;
 
-        if (bus_broadcast(u->meta.manager, m) < 0)
+        if (bus_broadcast(u->manager, m) < 0)
                 goto oom;
 
         free(p);
                 goto oom;
 
         free(p);
index 7a43410..6476c8a 100644 (file)
         "org.freedesktop.systemd1.Unit\0"
 
 #define BUS_UNIT_PROPERTIES \
         "org.freedesktop.systemd1.Unit\0"
 
 #define BUS_UNIT_PROPERTIES \
-        { "org.freedesktop.systemd1.Unit", "Id",                   bus_property_append_string,     "s",    u->meta.id                        }, \
+        { "org.freedesktop.systemd1.Unit", "Id",                   bus_property_append_string,     "s",    u->id                        }, \
         { "org.freedesktop.systemd1.Unit", "Names",                bus_unit_append_names,          "as",   u                                 }, \
         { "org.freedesktop.systemd1.Unit", "Following",            bus_unit_append_following,      "s",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "Names",                bus_unit_append_names,          "as",   u                                 }, \
         { "org.freedesktop.systemd1.Unit", "Following",            bus_unit_append_following,      "s",    u                                 }, \
-        { "org.freedesktop.systemd1.Unit", "Requires",             bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_REQUIRES] }, \
-        { "org.freedesktop.systemd1.Unit", "RequiresOverridable",  bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_REQUIRES_OVERRIDABLE] }, \
-        { "org.freedesktop.systemd1.Unit", "Requisite",            bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_REQUISITE] }, \
-        { "org.freedesktop.systemd1.Unit", "RequisiteOverridable", bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_REQUISITE_OVERRIDABLE] }, \
-        { "org.freedesktop.systemd1.Unit", "Wants",                bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_WANTS]  }, \
-        { "org.freedesktop.systemd1.Unit", "BindTo",               bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_BIND_TO]  }, \
-        { "org.freedesktop.systemd1.Unit", "RequiredBy",           bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_REQUIRED_BY] }, \
-        { "org.freedesktop.systemd1.Unit", "RequiredByOverridable",bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_REQUIRED_BY_OVERRIDABLE] }, \
-        { "org.freedesktop.systemd1.Unit", "WantedBy",             bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_WANTED_BY] }, \
-        { "org.freedesktop.systemd1.Unit", "BoundBy",              bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_BOUND_BY]  }, \
-        { "org.freedesktop.systemd1.Unit", "Conflicts",            bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_CONFLICTS] }, \
-        { "org.freedesktop.systemd1.Unit", "ConflictedBy",         bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_CONFLICTED_BY] }, \
-        { "org.freedesktop.systemd1.Unit", "Before",               bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_BEFORE] }, \
-        { "org.freedesktop.systemd1.Unit", "After",                bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_AFTER]  }, \
-        { "org.freedesktop.systemd1.Unit", "OnFailure",            bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_ON_FAILURE] }, \
-        { "org.freedesktop.systemd1.Unit", "Triggers",             bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_TRIGGERS] }, \
-        { "org.freedesktop.systemd1.Unit", "TriggeredBy",          bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_TRIGGERED_BY] }, \
-        { "org.freedesktop.systemd1.Unit", "PropagateReloadTo",    bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_PROPAGATE_RELOAD_TO] }, \
-        { "org.freedesktop.systemd1.Unit", "PropagateReloadFrom",  bus_unit_append_dependencies,   "as",   u->meta.dependencies[UNIT_PROPAGATE_RELOAD_FROM] }, \
+        { "org.freedesktop.systemd1.Unit", "Requires",             bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_REQUIRES] }, \
+        { "org.freedesktop.systemd1.Unit", "RequiresOverridable",  bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_REQUIRES_OVERRIDABLE] }, \
+        { "org.freedesktop.systemd1.Unit", "Requisite",            bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_REQUISITE] }, \
+        { "org.freedesktop.systemd1.Unit", "RequisiteOverridable", bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_REQUISITE_OVERRIDABLE] }, \
+        { "org.freedesktop.systemd1.Unit", "Wants",                bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_WANTS]  }, \
+        { "org.freedesktop.systemd1.Unit", "BindTo",               bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_BIND_TO]  }, \
+        { "org.freedesktop.systemd1.Unit", "RequiredBy",           bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_REQUIRED_BY] }, \
+        { "org.freedesktop.systemd1.Unit", "RequiredByOverridable",bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_REQUIRED_BY_OVERRIDABLE] }, \
+        { "org.freedesktop.systemd1.Unit", "WantedBy",             bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_WANTED_BY] }, \
+        { "org.freedesktop.systemd1.Unit", "BoundBy",              bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_BOUND_BY]  }, \
+        { "org.freedesktop.systemd1.Unit", "Conflicts",            bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_CONFLICTS] }, \
+        { "org.freedesktop.systemd1.Unit", "ConflictedBy",         bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_CONFLICTED_BY] }, \
+        { "org.freedesktop.systemd1.Unit", "Before",               bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_BEFORE] }, \
+        { "org.freedesktop.systemd1.Unit", "After",                bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_AFTER]  }, \
+        { "org.freedesktop.systemd1.Unit", "OnFailure",            bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_ON_FAILURE] }, \
+        { "org.freedesktop.systemd1.Unit", "Triggers",             bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_TRIGGERS] }, \
+        { "org.freedesktop.systemd1.Unit", "TriggeredBy",          bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_TRIGGERED_BY] }, \
+        { "org.freedesktop.systemd1.Unit", "PropagateReloadTo",    bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_PROPAGATE_RELOAD_TO] }, \
+        { "org.freedesktop.systemd1.Unit", "PropagateReloadFrom",  bus_unit_append_dependencies,   "as",   u->dependencies[UNIT_PROPAGATE_RELOAD_FROM] }, \
         { "org.freedesktop.systemd1.Unit", "Description",          bus_unit_append_description,    "s",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "Description",          bus_unit_append_description,    "s",    u                                 }, \
-        { "org.freedesktop.systemd1.Unit", "LoadState",            bus_unit_append_load_state,     "s",    &u->meta.load_state               }, \
+        { "org.freedesktop.systemd1.Unit", "LoadState",            bus_unit_append_load_state,     "s",    &u->load_state               }, \
         { "org.freedesktop.systemd1.Unit", "ActiveState",          bus_unit_append_active_state,   "s",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "SubState",             bus_unit_append_sub_state,      "s",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "ActiveState",          bus_unit_append_active_state,   "s",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "SubState",             bus_unit_append_sub_state,      "s",    u                                 }, \
-        { "org.freedesktop.systemd1.Unit", "FragmentPath",         bus_property_append_string,     "s",    u->meta.fragment_path             }, \
+        { "org.freedesktop.systemd1.Unit", "FragmentPath",         bus_property_append_string,     "s",    u->fragment_path             }, \
         { "org.freedesktop.systemd1.Unit", "UnitFileState",        bus_unit_append_file_state,     "s",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "UnitFileState",        bus_unit_append_file_state,     "s",    u                                 }, \
-        { "org.freedesktop.systemd1.Unit", "InactiveExitTimestamp",bus_property_append_usec,       "t",    &u->meta.inactive_exit_timestamp.realtime }, \
-        { "org.freedesktop.systemd1.Unit", "InactiveExitTimestampMonotonic",bus_property_append_usec, "t", &u->meta.inactive_exit_timestamp.monotonic }, \
-        { "org.freedesktop.systemd1.Unit", "ActiveEnterTimestamp", bus_property_append_usec,       "t",    &u->meta.active_enter_timestamp.realtime }, \
-        { "org.freedesktop.systemd1.Unit", "ActiveEnterTimestampMonotonic", bus_property_append_usec, "t", &u->meta.active_enter_timestamp.monotonic }, \
-        { "org.freedesktop.systemd1.Unit", "ActiveExitTimestamp",  bus_property_append_usec,       "t",    &u->meta.active_exit_timestamp.realtime }, \
-        { "org.freedesktop.systemd1.Unit", "ActiveExitTimestampMonotonic",  bus_property_append_usec, "t", &u->meta.active_exit_timestamp.monotonic }, \
-        { "org.freedesktop.systemd1.Unit", "InactiveEnterTimestamp",bus_property_append_usec,      "t",    &u->meta.inactive_enter_timestamp.realtime }, \
-        { "org.freedesktop.systemd1.Unit", "InactiveEnterTimestampMonotonic",bus_property_append_usec,"t", &u->meta.inactive_enter_timestamp.monotonic }, \
+        { "org.freedesktop.systemd1.Unit", "InactiveExitTimestamp",bus_property_append_usec,       "t",    &u->inactive_exit_timestamp.realtime }, \
+        { "org.freedesktop.systemd1.Unit", "InactiveExitTimestampMonotonic",bus_property_append_usec, "t", &u->inactive_exit_timestamp.monotonic }, \
+        { "org.freedesktop.systemd1.Unit", "ActiveEnterTimestamp", bus_property_append_usec,       "t",    &u->active_enter_timestamp.realtime }, \
+        { "org.freedesktop.systemd1.Unit", "ActiveEnterTimestampMonotonic", bus_property_append_usec, "t", &u->active_enter_timestamp.monotonic }, \
+        { "org.freedesktop.systemd1.Unit", "ActiveExitTimestamp",  bus_property_append_usec,       "t",    &u->active_exit_timestamp.realtime }, \
+        { "org.freedesktop.systemd1.Unit", "ActiveExitTimestampMonotonic",  bus_property_append_usec, "t", &u->active_exit_timestamp.monotonic }, \
+        { "org.freedesktop.systemd1.Unit", "InactiveEnterTimestamp",bus_property_append_usec,      "t",    &u->inactive_enter_timestamp.realtime }, \
+        { "org.freedesktop.systemd1.Unit", "InactiveEnterTimestampMonotonic",bus_property_append_usec,"t", &u->inactive_enter_timestamp.monotonic }, \
         { "org.freedesktop.systemd1.Unit", "CanStart",             bus_unit_append_can_start,      "b",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "CanStop",              bus_unit_append_can_stop,       "b",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "CanReload",            bus_unit_append_can_reload,     "b",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "CanIsolate",           bus_unit_append_can_isolate,    "b",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "Job",                  bus_unit_append_job,            "(uo)", u                                 }, \
         { "org.freedesktop.systemd1.Unit", "CanStart",             bus_unit_append_can_start,      "b",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "CanStop",              bus_unit_append_can_stop,       "b",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "CanReload",            bus_unit_append_can_reload,     "b",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "CanIsolate",           bus_unit_append_can_isolate,    "b",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "Job",                  bus_unit_append_job,            "(uo)", u                                 }, \
-        { "org.freedesktop.systemd1.Unit", "StopWhenUnneeded",     bus_property_append_bool,       "b",    &u->meta.stop_when_unneeded       }, \
-        { "org.freedesktop.systemd1.Unit", "RefuseManualStart",    bus_property_append_bool,       "b",    &u->meta.refuse_manual_start      }, \
-        { "org.freedesktop.systemd1.Unit", "RefuseManualStop",     bus_property_append_bool,       "b",    &u->meta.refuse_manual_stop       }, \
-        { "org.freedesktop.systemd1.Unit", "AllowIsolate",         bus_property_append_bool,       "b",    &u->meta.allow_isolate            }, \
-        { "org.freedesktop.systemd1.Unit", "DefaultDependencies",  bus_property_append_bool,       "b",    &u->meta.default_dependencies     }, \
-        { "org.freedesktop.systemd1.Unit", "OnFailureIsolate",     bus_property_append_bool,       "b",    &u->meta.on_failure_isolate       }, \
-        { "org.freedesktop.systemd1.Unit", "IgnoreOnIsolate",      bus_property_append_bool,       "b",    &u->meta.ignore_on_isolate        }, \
-        { "org.freedesktop.systemd1.Unit", "IgnoreOnSnapshot",     bus_property_append_bool,       "b",    &u->meta.ignore_on_snapshot       }, \
+        { "org.freedesktop.systemd1.Unit", "StopWhenUnneeded",     bus_property_append_bool,       "b",    &u->stop_when_unneeded       }, \
+        { "org.freedesktop.systemd1.Unit", "RefuseManualStart",    bus_property_append_bool,       "b",    &u->refuse_manual_start      }, \
+        { "org.freedesktop.systemd1.Unit", "RefuseManualStop",     bus_property_append_bool,       "b",    &u->refuse_manual_stop       }, \
+        { "org.freedesktop.systemd1.Unit", "AllowIsolate",         bus_property_append_bool,       "b",    &u->allow_isolate            }, \
+        { "org.freedesktop.systemd1.Unit", "DefaultDependencies",  bus_property_append_bool,       "b",    &u->default_dependencies     }, \
+        { "org.freedesktop.systemd1.Unit", "OnFailureIsolate",     bus_property_append_bool,       "b",    &u->on_failure_isolate       }, \
+        { "org.freedesktop.systemd1.Unit", "IgnoreOnIsolate",      bus_property_append_bool,       "b",    &u->ignore_on_isolate        }, \
+        { "org.freedesktop.systemd1.Unit", "IgnoreOnSnapshot",     bus_property_append_bool,       "b",    &u->ignore_on_snapshot       }, \
         { "org.freedesktop.systemd1.Unit", "DefaultControlGroup",  bus_unit_append_default_cgroup, "s",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "ControlGroup",         bus_unit_append_cgroups,        "as",   u                                 }, \
         { "org.freedesktop.systemd1.Unit", "ControlGroupAttributes", bus_unit_append_cgroup_attrs, "a(sss)", u                               }, \
         { "org.freedesktop.systemd1.Unit", "NeedDaemonReload",     bus_unit_append_need_daemon_reload, "b", u                                }, \
         { "org.freedesktop.systemd1.Unit", "DefaultControlGroup",  bus_unit_append_default_cgroup, "s",    u                                 }, \
         { "org.freedesktop.systemd1.Unit", "ControlGroup",         bus_unit_append_cgroups,        "as",   u                                 }, \
         { "org.freedesktop.systemd1.Unit", "ControlGroupAttributes", bus_unit_append_cgroup_attrs, "a(sss)", u                               }, \
         { "org.freedesktop.systemd1.Unit", "NeedDaemonReload",     bus_unit_append_need_daemon_reload, "b", u                                }, \
-        { "org.freedesktop.systemd1.Unit", "JobTimeoutUSec",       bus_property_append_usec,       "t",    &u->meta.job_timeout              }, \
-        { "org.freedesktop.systemd1.Unit", "ConditionTimestamp",   bus_property_append_usec,       "t",    &u->meta.condition_timestamp.realtime }, \
-        { "org.freedesktop.systemd1.Unit", "ConditionTimestampMonotonic", bus_property_append_usec,"t",    &u->meta.condition_timestamp.monotonic }, \
-        { "org.freedesktop.systemd1.Unit", "ConditionResult",      bus_property_append_bool,       "b",    &u->meta.condition_result         }, \
+        { "org.freedesktop.systemd1.Unit", "JobTimeoutUSec",       bus_property_append_usec,       "t",    &u->job_timeout              }, \
+        { "org.freedesktop.systemd1.Unit", "ConditionTimestamp",   bus_property_append_usec,       "t",    &u->condition_timestamp.realtime }, \
+        { "org.freedesktop.systemd1.Unit", "ConditionTimestampMonotonic", bus_property_append_usec,"t",    &u->condition_timestamp.monotonic }, \
+        { "org.freedesktop.systemd1.Unit", "ConditionResult",      bus_property_append_bool,       "b",    &u->condition_result         }, \
         { "org.freedesktop.systemd1.Unit", "LoadError",            bus_unit_append_load_error,     "(ss)", u                                 }
 
 int bus_unit_append_names(DBusMessageIter *i, const char *property, void *data);
         { "org.freedesktop.systemd1.Unit", "LoadError",            bus_unit_append_load_error,     "(ss)", u                                 }
 
 int bus_unit_append_names(DBusMessageIter *i, const char *property, void *data);
index f9250f1..8e6e9fd 100644 (file)
@@ -370,7 +370,7 @@ static DBusHandlerResult api_bus_message_filter(DBusConnection *connection, DBus
                         } else {
                                 r = manager_load_unit(m, name, NULL, &error, &u);
 
                         } else {
                                 r = manager_load_unit(m, name, NULL, &error, &u);
 
-                                if (r >= 0 && u->meta.refuse_manual_start)
+                                if (r >= 0 && u->refuse_manual_start)
                                         r = -EPERM;
 
                                 if (r >= 0)
                                         r = -EPERM;
 
                                 if (r >= 0)
index 64665a8..9e5bd30 100644 (file)
@@ -389,7 +389,7 @@ static Unit *device_following(Unit *u) {
 
         assert(d);
 
 
         assert(d);
 
-        if (startswith(u->meta.id, "sys-"))
+        if (startswith(u->id, "sys-"))
                 return NULL;
 
         /* Make everybody follow the unit that's named after the sysfs path */
                 return NULL;
 
         /* Make everybody follow the unit that's named after the sysfs path */
index 9a56a52..a05c3d3 100644 (file)
@@ -36,7 +36,7 @@ typedef enum DeviceState {
 } DeviceState;
 
 struct Device {
 } DeviceState;
 
 struct Device {
-        Meta meta;
+        Unit meta;
 
         char *sysfs;
 
 
         char *sysfs;
 
index 85f2dee..e57286f 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -62,8 +62,8 @@ void job_free(Job *j) {
         if (j->installed) {
                 bus_job_send_removed_signal(j);
 
         if (j->installed) {
                 bus_job_send_removed_signal(j);
 
-                if (j->unit->meta.job == j) {
-                        j->unit->meta.job = NULL;
+                if (j->unit->job == j) {
+                        j->unit->job = NULL;
                         unit_add_to_gc_queue(j->unit);
                 }
 
                         unit_add_to_gc_queue(j->unit);
                 }
 
@@ -147,7 +147,7 @@ void job_dump(Job *j, FILE*f, const char *prefix) {
                 "%s\tState: %s\n"
                 "%s\tForced: %s\n",
                 prefix, j->id,
                 "%s\tState: %s\n"
                 "%s\tForced: %s\n",
                 prefix, j->id,
-                prefix, j->unit->meta.id, job_type_to_string(j->type),
+                prefix, j->unit->id, job_type_to_string(j->type),
                 prefix, job_state_to_string(j->state),
                 prefix, yes_no(j->override));
 }
                 prefix, job_state_to_string(j->state),
                 prefix, yes_no(j->override));
 }
@@ -326,19 +326,19 @@ bool job_is_runnable(Job *j) {
                  * dependencies, regardless whether they are
                  * starting or stopping something. */
 
                  * dependencies, regardless whether they are
                  * starting or stopping something. */
 
-                SET_FOREACH(other, j->unit->meta.dependencies[UNIT_AFTER], i)
-                        if (other->meta.job)
+                SET_FOREACH(other, j->unit->dependencies[UNIT_AFTER], i)
+                        if (other->job)
                                 return false;
         }
 
         /* Also, if something else is being stopped and we should
          * change state after it, then lets wait. */
 
                                 return false;
         }
 
         /* Also, if something else is being stopped and we should
          * change state after it, then lets wait. */
 
-        SET_FOREACH(other, j->unit->meta.dependencies[UNIT_BEFORE], i)
-                if (other->meta.job &&
-                    (other->meta.job->type == JOB_STOP ||
-                     other->meta.job->type == JOB_RESTART ||
-                     other->meta.job->type == JOB_TRY_RESTART))
+        SET_FOREACH(other, j->unit->dependencies[UNIT_BEFORE], i)
+                if (other->job &&
+                    (other->job->type == JOB_STOP ||
+                     other->job->type == JOB_RESTART ||
+                     other->job->type == JOB_TRY_RESTART))
                         return false;
 
         /* This means that for a service a and a service b where b
                         return false;
 
         /* This means that for a service a and a service b where b
@@ -489,7 +489,7 @@ static void job_print_status_message(Unit *u, JobType t, JobResult result) {
 
                 case JOB_FAILED:
                         unit_status_printf(u, ANSI_HIGHLIGHT_RED_ON "FAILED" ANSI_HIGHLIGHT_OFF, "Failed to start %s", unit_description(u));
 
                 case JOB_FAILED:
                         unit_status_printf(u, ANSI_HIGHLIGHT_RED_ON "FAILED" ANSI_HIGHLIGHT_OFF, "Failed to start %s", unit_description(u));
-                        unit_status_printf(u, NULL, "See 'systemctl status %s' for details.", u->meta.id);
+                        unit_status_printf(u, NULL, "See 'systemctl status %s' for details.", u->id);
                         break;
 
                 case JOB_DEPENDENCY:
                         break;
 
                 case JOB_DEPENDENCY:
@@ -539,8 +539,8 @@ int job_finish_and_invalidate(Job *j, JobResult result) {
         if (result == JOB_DONE && (j->type == JOB_RESTART || j->type == JOB_TRY_RESTART)) {
 
                 log_debug("Converting job %s/%s -> %s/%s",
         if (result == JOB_DONE && (j->type == JOB_RESTART || j->type == JOB_TRY_RESTART)) {
 
                 log_debug("Converting job %s/%s -> %s/%s",
-                          j->unit->meta.id, job_type_to_string(j->type),
-                          j->unit->meta.id, job_type_to_string(JOB_START));
+                          j->unit->id, job_type_to_string(j->type),
+                          j->unit->id, job_type_to_string(JOB_START));
 
                 j->state = JOB_WAITING;
                 j->type = JOB_START;
 
                 j->state = JOB_WAITING;
                 j->type = JOB_START;
@@ -553,7 +553,7 @@ int job_finish_and_invalidate(Job *j, JobResult result) {
 
         j->result = result;
 
 
         j->result = result;
 
-        log_debug("Job %s/%s finished, result=%s", j->unit->meta.id, job_type_to_string(j->type), job_result_to_string(result));
+        log_debug("Job %s/%s finished, result=%s", j->unit->id, job_type_to_string(j->type), job_result_to_string(result));
 
         if (result == JOB_FAILED)
                 j->manager->n_failed_jobs ++;
 
         if (result == JOB_FAILED)
                 j->manager->n_failed_jobs ++;
@@ -571,42 +571,42 @@ int job_finish_and_invalidate(Job *j, JobResult result) {
                     t == JOB_VERIFY_ACTIVE ||
                     t == JOB_RELOAD_OR_START) {
 
                     t == JOB_VERIFY_ACTIVE ||
                     t == JOB_RELOAD_OR_START) {
 
-                        SET_FOREACH(other, u->meta.dependencies[UNIT_REQUIRED_BY], i)
-                                if (other->meta.job &&
-                                    (other->meta.job->type == JOB_START ||
-                                     other->meta.job->type == JOB_VERIFY_ACTIVE ||
-                                     other->meta.job->type == JOB_RELOAD_OR_START)) {
-                                        job_finish_and_invalidate(other->meta.job, JOB_DEPENDENCY);
+                        SET_FOREACH(other, u->dependencies[UNIT_REQUIRED_BY], i)
+                                if (other->job &&
+                                    (other->job->type == JOB_START ||
+                                     other->job->type == JOB_VERIFY_ACTIVE ||
+                                     other->job->type == JOB_RELOAD_OR_START)) {
+                                        job_finish_and_invalidate(other->job, JOB_DEPENDENCY);
                                         recursed = true;
                                 }
 
                                         recursed = true;
                                 }
 
-                        SET_FOREACH(other, u->meta.dependencies[UNIT_BOUND_BY], i)
-                                if (other->meta.job &&
-                                    (other->meta.job->type == JOB_START ||
-                                     other->meta.job->type == JOB_VERIFY_ACTIVE ||
-                                     other->meta.job->type == JOB_RELOAD_OR_START)) {
-                                        job_finish_and_invalidate(other->meta.job, JOB_DEPENDENCY);
+                        SET_FOREACH(other, u->dependencies[UNIT_BOUND_BY], i)
+                                if (other->job &&
+                                    (other->job->type == JOB_START ||
+                                     other->job->type == JOB_VERIFY_ACTIVE ||
+                                     other->job->type == JOB_RELOAD_OR_START)) {
+                                        job_finish_and_invalidate(other->job, JOB_DEPENDENCY);
                                         recursed = true;
                                 }
 
                                         recursed = true;
                                 }
 
-                        SET_FOREACH(other, u->meta.dependencies[UNIT_REQUIRED_BY_OVERRIDABLE], i)
-                                if (other->meta.job &&
-                                    !other->meta.job->override &&
-                                    (other->meta.job->type == JOB_START ||
-                                     other->meta.job->type == JOB_VERIFY_ACTIVE ||
-                                     other->meta.job->type == JOB_RELOAD_OR_START)) {
-                                        job_finish_and_invalidate(other->meta.job, JOB_DEPENDENCY);
+                        SET_FOREACH(other, u->dependencies[UNIT_REQUIRED_BY_OVERRIDABLE], i)
+                                if (other->job &&
+                                    !other->job->override &&
+                                    (other->job->type == JOB_START ||
+                                     other->job->type == JOB_VERIFY_ACTIVE ||
+                                     other->job->type == JOB_RELOAD_OR_START)) {
+                                        job_finish_and_invalidate(other->job, JOB_DEPENDENCY);
                                         recursed = true;
                                 }
 
                 } else if (t == JOB_STOP) {
 
                                         recursed = true;
                                 }
 
                 } else if (t == JOB_STOP) {
 
-                        SET_FOREACH(other, u->meta.dependencies[UNIT_CONFLICTED_BY], i)
-                                if (other->meta.job &&
-                                    (other->meta.job->type == JOB_START ||
-                                     other->meta.job->type == JOB_VERIFY_ACTIVE ||
-                                     other->meta.job->type == JOB_RELOAD_OR_START)) {
-                                        job_finish_and_invalidate(other->meta.job, JOB_DEPENDENCY);
+                        SET_FOREACH(other, u->dependencies[UNIT_CONFLICTED_BY], i)
+                                if (other->job &&
+                                    (other->job->type == JOB_START ||
+                                     other->job->type == JOB_VERIFY_ACTIVE ||
+                                     other->job->type == JOB_RELOAD_OR_START)) {
+                                        job_finish_and_invalidate(other->job, JOB_DEPENDENCY);
                                         recursed = true;
                                 }
                 }
                                         recursed = true;
                                 }
                 }
@@ -618,7 +618,7 @@ int job_finish_and_invalidate(Job *j, JobResult result) {
          * unit itself. */
         if (result == JOB_TIMEOUT || result == JOB_DEPENDENCY) {
                 log_notice("Job %s/%s failed with result '%s'.",
          * unit itself. */
         if (result == JOB_TIMEOUT || result == JOB_DEPENDENCY) {
                 log_notice("Job %s/%s failed with result '%s'.",
-                           u->meta.id,
+                           u->id,
                            job_type_to_string(t),
                            job_result_to_string(result));
 
                            job_type_to_string(t),
                            job_result_to_string(result));
 
@@ -627,14 +627,14 @@ int job_finish_and_invalidate(Job *j, JobResult result) {
 
 finish:
         /* Try to start the next jobs that can be started */
 
 finish:
         /* Try to start the next jobs that can be started */
-        SET_FOREACH(other, u->meta.dependencies[UNIT_AFTER], i)
-                if (other->meta.job)
-                        job_add_to_run_queue(other->meta.job);
-        SET_FOREACH(other, u->meta.dependencies[UNIT_BEFORE], i)
-                if (other->meta.job)
-                        job_add_to_run_queue(other->meta.job);
+        SET_FOREACH(other, u->dependencies[UNIT_AFTER], i)
+                if (other->job)
+                        job_add_to_run_queue(other->job);
+        SET_FOREACH(other, u->dependencies[UNIT_BEFORE], i)
+                if (other->job)
+                        job_add_to_run_queue(other->job);
 
 
-        manager_check_finished(u->meta.manager);
+        manager_check_finished(u->manager);
 
         return recursed;
 }
 
         return recursed;
 }
@@ -645,7 +645,7 @@ int job_start_timer(Job *j) {
         int fd, r;
         assert(j);
 
         int fd, r;
         assert(j);
 
-        if (j->unit->meta.job_timeout <= 0 ||
+        if (j->unit->job_timeout <= 0 ||
             j->timer_watch.type == WATCH_JOB_TIMER)
                 return 0;
 
             j->timer_watch.type == WATCH_JOB_TIMER)
                 return 0;
 
@@ -657,7 +657,7 @@ int job_start_timer(Job *j) {
         }
 
         zero(its);
         }
 
         zero(its);
-        timespec_store(&its.it_value, j->unit->meta.job_timeout);
+        timespec_store(&its.it_value, j->unit->job_timeout);
 
         if (timerfd_settime(fd, 0, &its, NULL) < 0) {
                 r = -errno;
 
         if (timerfd_settime(fd, 0, &its, NULL) < 0) {
                 r = -errno;
@@ -727,7 +727,7 @@ void job_timer_event(Job *j, uint64_t n_elapsed, Watch *w) {
         assert(j);
         assert(w == &j->timer_watch);
 
         assert(j);
         assert(w == &j->timer_watch);
 
-        log_warning("Job %s/%s timed out.", j->unit->meta.id, job_type_to_string(j->type));
+        log_warning("Job %s/%s timed out.", j->unit->id, job_type_to_string(j->type));
         job_finish_and_invalidate(j, JOB_TIMEOUT);
 }
 
         job_finish_and_invalidate(j, JOB_TIMEOUT);
 }
 
index d114faa..d869ee0 100644 (file)
@@ -61,7 +61,7 @@ static int iterate_dir(Unit *u, const char *path, UnitDependency dependency) {
                 free(f);
 
                 if (r < 0)
                 free(f);
 
                 if (r < 0)
-                        log_error("Cannot add dependency %s to %s, ignoring: %s", de->d_name, u->meta.id, strerror(-r));
+                        log_error("Cannot add dependency %s to %s, ignoring: %s", de->d_name, u->id, strerror(-r));
         }
 
         r = 0;
         }
 
         r = 0;
@@ -84,8 +84,8 @@ static int process_dir(Unit *u, const char *unit_path, const char *name, const c
         if (!path)
                 return -ENOMEM;
 
         if (!path)
                 return -ENOMEM;
 
-        if (u->meta.manager->unit_path_cache &&
-            !set_get(u->meta.manager->unit_path_cache, path))
+        if (u->manager->unit_path_cache &&
+            !set_get(u->manager->unit_path_cache, path))
                 r = 0;
         else
                 r = iterate_dir(u, path, dependency);
                 r = 0;
         else
                 r = iterate_dir(u, path, dependency);
@@ -94,7 +94,7 @@ static int process_dir(Unit *u, const char *unit_path, const char *name, const c
         if (r < 0)
                 return r;
 
         if (r < 0)
                 return r;
 
-        if (u->meta.instance) {
+        if (u->instance) {
                 char *template;
                 /* Also try the template dir */
 
                 char *template;
                 /* Also try the template dir */
 
@@ -108,8 +108,8 @@ static int process_dir(Unit *u, const char *unit_path, const char *name, const c
                 if (!path)
                         return -ENOMEM;
 
                 if (!path)
                         return -ENOMEM;
 
-                if (u->meta.manager->unit_path_cache &&
-                    !set_get(u->meta.manager->unit_path_cache, path))
+                if (u->manager->unit_path_cache &&
+                    !set_get(u->manager->unit_path_cache, path))
                         r = 0;
                 else
                         r = iterate_dir(u, path, dependency);
                         r = 0;
                 else
                         r = iterate_dir(u, path, dependency);
@@ -130,10 +130,10 @@ int unit_load_dropin(Unit *u) {
 
         /* Load dependencies from supplementary drop-in directories */
 
 
         /* Load dependencies from supplementary drop-in directories */
 
-        SET_FOREACH(t, u->meta.names, i) {
+        SET_FOREACH(t, u->names, i) {
                 char **p;
 
                 char **p;
 
-                STRV_FOREACH(p, u->meta.manager->lookup_paths.unit_path) {
+                STRV_FOREACH(p, u->manager->lookup_paths.unit_path) {
                         int r;
 
                         r = process_dir(u, *p, t, ".wants", UNIT_WANTS);
                         int r;
 
                         r = process_dir(u, *p, t, ".wants", UNIT_WANTS);
index 11e6324..c3f2957 100644 (file)
@@ -89,7 +89,7 @@ $1.UtmpIdentifier,               config_parse_unit_string_printf,    0,
 $1.ControlGroupModify,           config_parse_bool,                  0,                             offsetof($1, exec_context.control_group_modify)'
 )m4_dnl
 Unit.Names,                      config_parse_unit_names,            0,                             0
 $1.ControlGroupModify,           config_parse_bool,                  0,                             offsetof($1, exec_context.control_group_modify)'
 )m4_dnl
 Unit.Names,                      config_parse_unit_names,            0,                             0
-Unit.Description,                config_parse_unit_string_printf,    0,                             offsetof(Meta, description)
+Unit.Description,                config_parse_unit_string_printf,    0,                             offsetof(Unit, description)
 Unit.Requires,                   config_parse_unit_deps,             UNIT_REQUIRES,                 0
 Unit.RequiresOverridable,        config_parse_unit_deps,             UNIT_REQUIRES_OVERRIDABLE,     0
 Unit.Requisite,                  config_parse_unit_deps,             UNIT_REQUISITE,                0
 Unit.Requires,                   config_parse_unit_deps,             UNIT_REQUIRES,                 0
 Unit.RequiresOverridable,        config_parse_unit_deps,             UNIT_REQUIRES_OVERRIDABLE,     0
 Unit.Requisite,                  config_parse_unit_deps,             UNIT_REQUISITE,                0
@@ -102,15 +102,15 @@ Unit.After,                      config_parse_unit_deps,             UNIT_AFTER,
 Unit.OnFailure,                  config_parse_unit_deps,             UNIT_ON_FAILURE,               0
 Unit.PropagateReloadTo,          config_parse_unit_deps,             UNIT_PROPAGATE_RELOAD_TO,      0
 Unit.PropagateReloadFrom,        config_parse_unit_deps,             UNIT_PROPAGATE_RELOAD_FROM,    0
 Unit.OnFailure,                  config_parse_unit_deps,             UNIT_ON_FAILURE,               0
 Unit.PropagateReloadTo,          config_parse_unit_deps,             UNIT_PROPAGATE_RELOAD_TO,      0
 Unit.PropagateReloadFrom,        config_parse_unit_deps,             UNIT_PROPAGATE_RELOAD_FROM,    0
-Unit.StopWhenUnneeded,           config_parse_bool,                  0,                             offsetof(Meta, stop_when_unneeded)
-Unit.RefuseManualStart,          config_parse_bool,                  0,                             offsetof(Meta, refuse_manual_start)
-Unit.RefuseManualStop,           config_parse_bool,                  0,                             offsetof(Meta, refuse_manual_stop)
-Unit.AllowIsolate,               config_parse_bool,                  0,                             offsetof(Meta, allow_isolate)
-Unit.DefaultDependencies,        config_parse_bool,                  0,                             offsetof(Meta, default_dependencies)
-Unit.OnFailureIsolate,           config_parse_bool,                  0,                             offsetof(Meta, on_failure_isolate)
-Unit.IgnoreOnIsolate,            config_parse_bool,                  0,                             offsetof(Meta, ignore_on_isolate)
-Unit.IgnoreOnSnapshot,           config_parse_bool,                  0,                             offsetof(Meta, ignore_on_snapshot)
-Unit.JobTimeoutSec,              config_parse_usec,                  0,                             offsetof(Meta, job_timeout)
+Unit.StopWhenUnneeded,           config_parse_bool,                  0,                             offsetof(Unit, stop_when_unneeded)
+Unit.RefuseManualStart,          config_parse_bool,                  0,                             offsetof(Unit, refuse_manual_start)
+Unit.RefuseManualStop,           config_parse_bool,                  0,                             offsetof(Unit, refuse_manual_stop)
+Unit.AllowIsolate,               config_parse_bool,                  0,                             offsetof(Unit, allow_isolate)
+Unit.DefaultDependencies,        config_parse_bool,                  0,                             offsetof(Unit, default_dependencies)
+Unit.OnFailureIsolate,           config_parse_bool,                  0,                             offsetof(Unit, on_failure_isolate)
+Unit.IgnoreOnIsolate,            config_parse_bool,                  0,                             offsetof(Unit, ignore_on_isolate)
+Unit.IgnoreOnSnapshot,           config_parse_bool,                  0,                             offsetof(Unit, ignore_on_snapshot)
+Unit.JobTimeoutSec,              config_parse_usec,                  0,                             offsetof(Unit, job_timeout)
 Unit.ConditionPathExists,        config_parse_unit_condition_path,   CONDITION_PATH_EXISTS,         0
 Unit.ConditionPathExistsGlob,    config_parse_unit_condition_path,   CONDITION_PATH_EXISTS_GLOB,    0
 Unit.ConditionPathIsDirectory,   config_parse_unit_condition_path,   CONDITION_PATH_IS_DIRECTORY,   0
 Unit.ConditionPathExists,        config_parse_unit_condition_path,   CONDITION_PATH_EXISTS,         0
 Unit.ConditionPathExistsGlob,    config_parse_unit_condition_path,   CONDITION_PATH_EXISTS_GLOB,    0
 Unit.ConditionPathIsDirectory,   config_parse_unit_condition_path,   CONDITION_PATH_IS_DIRECTORY,   0
index ef5d192..213b1e2 100644 (file)
@@ -1569,7 +1569,7 @@ int config_parse_unit_condition_path(
         if (!c)
                 return -ENOMEM;
 
         if (!c)
                 return -ENOMEM;
 
-        LIST_PREPEND(Condition, conditions, u->meta.conditions, c);
+        LIST_PREPEND(Condition, conditions, u->conditions, c);
         return 0;
 }
 
         return 0;
 }
 
@@ -1602,7 +1602,7 @@ int config_parse_unit_condition_string(
         if (!(c = condition_new(cond, rvalue, trigger, negate)))
                 return -ENOMEM;
 
         if (!(c = condition_new(cond, rvalue, trigger, negate)))
                 return -ENOMEM;
 
-        LIST_PREPEND(Condition, conditions, u->meta.conditions, c);
+        LIST_PREPEND(Condition, conditions, u->conditions, c);
         return 0;
 }
 
         return 0;
 }
 
@@ -1643,7 +1643,7 @@ int config_parse_unit_condition_null(
         if (!(c = condition_new(CONDITION_NULL, NULL, trigger, negate)))
                 return -ENOMEM;
 
         if (!(c = condition_new(CONDITION_NULL, NULL, trigger, negate)))
                 return -ENOMEM;
 
-        LIST_PREPEND(Condition, conditions, u->meta.conditions, c);
+        LIST_PREPEND(Condition, conditions, u->conditions, c);
         return 0;
 }
 
         return 0;
 }
 
@@ -2109,7 +2109,7 @@ static int merge_by_names(Unit **u, Set *names, const char *id) {
                          * ours? Then let's try it the other way
                          * round */
 
                          * ours? Then let's try it the other way
                          * round */
 
-                        other = manager_get_unit((*u)->meta.manager, k);
+                        other = manager_get_unit((*u)->manager, k);
                         free(k);
 
                         if (other)
                         free(k);
 
                         if (other)
@@ -2163,7 +2163,7 @@ static int load_from_path(Unit *u, const char *path) {
         } else  {
                 char **p;
 
         } else  {
                 char **p;
 
-                STRV_FOREACH(p, u->meta.manager->lookup_paths.unit_path) {
+                STRV_FOREACH(p, u->manager->lookup_paths.unit_path) {
 
                         /* Instead of opening the path right away, we manually
                          * follow all symlinks and add their name to our unit
 
                         /* Instead of opening the path right away, we manually
                          * follow all symlinks and add their name to our unit
@@ -2173,8 +2173,8 @@ static int load_from_path(Unit *u, const char *path) {
                                 goto finish;
                         }
 
                                 goto finish;
                         }
 
-                        if (u->meta.manager->unit_path_cache &&
-                            !set_get(u->meta.manager->unit_path_cache, filename))
+                        if (u->manager->unit_path_cache &&
+                            !set_get(u->manager->unit_path_cache, filename))
                                 r = -ENOENT;
                         else
                                 r = open_follow(&filename, &f, symlink_names, &id);
                                 r = -ENOENT;
                         else
                                 r = open_follow(&filename, &f, symlink_names, &id);
@@ -2210,7 +2210,7 @@ static int load_from_path(Unit *u, const char *path) {
                 goto finish;
 
         if (merged != u) {
                 goto finish;
 
         if (merged != u) {
-                u->meta.load_state = UNIT_MERGED;
+                u->load_state = UNIT_MERGED;
                 r = 0;
                 goto finish;
         }
                 r = 0;
                 goto finish;
         }
@@ -2222,21 +2222,21 @@ static int load_from_path(Unit *u, const char *path) {
         }
 
         if (null_or_empty(&st))
         }
 
         if (null_or_empty(&st))
-                u->meta.load_state = UNIT_MASKED;
+                u->load_state = UNIT_MASKED;
         else {
                 /* Now, parse the file contents */
                 r = config_parse(filename, f, UNIT_VTABLE(u)->sections, config_item_perf_lookup, (void*) load_fragment_gperf_lookup, false, u);
                 if (r < 0)
                         goto finish;
 
         else {
                 /* Now, parse the file contents */
                 r = config_parse(filename, f, UNIT_VTABLE(u)->sections, config_item_perf_lookup, (void*) load_fragment_gperf_lookup, false, u);
                 if (r < 0)
                         goto finish;
 
-                u->meta.load_state = UNIT_LOADED;
+                u->load_state = UNIT_LOADED;
         }
 
         }
 
-        free(u->meta.fragment_path);
-        u->meta.fragment_path = filename;
+        free(u->fragment_path);
+        u->fragment_path = filename;
         filename = NULL;
 
         filename = NULL;
 
-        u->meta.fragment_mtime = timespec_load(&st.st_mtim);
+        u->fragment_mtime = timespec_load(&st.st_mtim);
 
         r = 0;
 
 
         r = 0;
 
@@ -2256,49 +2256,49 @@ int unit_load_fragment(Unit *u) {
         const char *t;
 
         assert(u);
         const char *t;
 
         assert(u);
-        assert(u->meta.load_state == UNIT_STUB);
-        assert(u->meta.id);
+        assert(u->load_state == UNIT_STUB);
+        assert(u->id);
 
         /* First, try to find the unit under its id. We always look
          * for unit files in the default directories, to make it easy
          * to override things by placing things in /etc/systemd/system */
 
         /* First, try to find the unit under its id. We always look
          * for unit files in the default directories, to make it easy
          * to override things by placing things in /etc/systemd/system */
-        if ((r = load_from_path(u, u->meta.id)) < 0)
+        if ((r = load_from_path(u, u->id)) < 0)
                 return r;
 
         /* Try to find an alias we can load this with */
                 return r;
 
         /* Try to find an alias we can load this with */
-        if (u->meta.load_state == UNIT_STUB)
-                SET_FOREACH(t, u->meta.names, i) {
+        if (u->load_state == UNIT_STUB)
+                SET_FOREACH(t, u->names, i) {
 
 
-                        if (t == u->meta.id)
+                        if (t == u->id)
                                 continue;
 
                         if ((r = load_from_path(u, t)) < 0)
                                 return r;
 
                                 continue;
 
                         if ((r = load_from_path(u, t)) < 0)
                                 return r;
 
-                        if (u->meta.load_state != UNIT_STUB)
+                        if (u->load_state != UNIT_STUB)
                                 break;
                 }
 
         /* And now, try looking for it under the suggested (originally linked) path */
                                 break;
                 }
 
         /* And now, try looking for it under the suggested (originally linked) path */
-        if (u->meta.load_state == UNIT_STUB && u->meta.fragment_path) {
+        if (u->load_state == UNIT_STUB && u->fragment_path) {
 
 
-                if ((r = load_from_path(u, u->meta.fragment_path)) < 0)
+                if ((r = load_from_path(u, u->fragment_path)) < 0)
                         return r;
 
                         return r;
 
-                if (u->meta.load_state == UNIT_STUB) {
+                if (u->load_state == UNIT_STUB) {
                         /* Hmm, this didn't work? Then let's get rid
                          * of the fragment path stored for us, so that
                          * we don't point to an invalid location. */
                         /* Hmm, this didn't work? Then let's get rid
                          * of the fragment path stored for us, so that
                          * we don't point to an invalid location. */
-                        free(u->meta.fragment_path);
-                        u->meta.fragment_path = NULL;
+                        free(u->fragment_path);
+                        u->fragment_path = NULL;
                 }
         }
 
         /* Look for a template */
                 }
         }
 
         /* Look for a template */
-        if (u->meta.load_state == UNIT_STUB && u->meta.instance) {
+        if (u->load_state == UNIT_STUB && u->instance) {
                 char *k;
 
                 char *k;
 
-                if (!(k = unit_name_template(u->meta.id)))
+                if (!(k = unit_name_template(u->id)))
                         return -ENOMEM;
 
                 r = load_from_path(u, k);
                         return -ENOMEM;
 
                 r = load_from_path(u, k);
@@ -2307,10 +2307,10 @@ int unit_load_fragment(Unit *u) {
                 if (r < 0)
                         return r;
 
                 if (r < 0)
                         return r;
 
-                if (u->meta.load_state == UNIT_STUB)
-                        SET_FOREACH(t, u->meta.names, i) {
+                if (u->load_state == UNIT_STUB)
+                        SET_FOREACH(t, u->names, i) {
 
 
-                                if (t == u->meta.id)
+                                if (t == u->id)
                                         continue;
 
                                 if (!(k = unit_name_template(t)))
                                         continue;
 
                                 if (!(k = unit_name_template(t)))
@@ -2322,7 +2322,7 @@ int unit_load_fragment(Unit *u) {
                                 if (r < 0)
                                         return r;
 
                                 if (r < 0)
                                         return r;
 
-                                if (u->meta.load_state != UNIT_STUB)
+                                if (u->load_state != UNIT_STUB)
                                         break;
                         }
         }
                                         break;
                         }
         }
index 91516da..cec9b49 100644 (file)
@@ -1408,28 +1408,28 @@ int main(int argc, char *argv[]) {
                 if ((r = manager_load_unit(m, arg_default_unit, NULL, &error, &target)) < 0) {
                         log_error("Failed to load default target: %s", bus_error(&error, r));
                         dbus_error_free(&error);
                 if ((r = manager_load_unit(m, arg_default_unit, NULL, &error, &target)) < 0) {
                         log_error("Failed to load default target: %s", bus_error(&error, r));
                         dbus_error_free(&error);
-                } else if (target->meta.load_state == UNIT_ERROR)
-                        log_error("Failed to load default target: %s", strerror(-target->meta.load_error));
-                else if (target->meta.load_state == UNIT_MASKED)
+                } else if (target->load_state == UNIT_ERROR)
+                        log_error("Failed to load default target: %s", strerror(-target->load_error));
+                else if (target->load_state == UNIT_MASKED)
                         log_error("Default target masked.");
 
                         log_error("Default target masked.");
 
-                if (!target || target->meta.load_state != UNIT_LOADED) {
+                if (!target || target->load_state != UNIT_LOADED) {
                         log_info("Trying to load rescue target...");
 
                         if ((r = manager_load_unit(m, SPECIAL_RESCUE_TARGET, NULL, &error, &target)) < 0) {
                                 log_error("Failed to load rescue target: %s", bus_error(&error, r));
                                 dbus_error_free(&error);
                                 goto finish;
                         log_info("Trying to load rescue target...");
 
                         if ((r = manager_load_unit(m, SPECIAL_RESCUE_TARGET, NULL, &error, &target)) < 0) {
                                 log_error("Failed to load rescue target: %s", bus_error(&error, r));
                                 dbus_error_free(&error);
                                 goto finish;
-                        } else if (target->meta.load_state == UNIT_ERROR) {
-                                log_error("Failed to load rescue target: %s", strerror(-target->meta.load_error));
+                        } else if (target->load_state == UNIT_ERROR) {
+                                log_error("Failed to load rescue target: %s", strerror(-target->load_error));
                                 goto finish;
                                 goto finish;
-                        } else if (target->meta.load_state == UNIT_MASKED) {
+                        } else if (target->load_state == UNIT_MASKED) {
                                 log_error("Rescue target masked.");
                                 goto finish;
                         }
                 }
 
                                 log_error("Rescue target masked.");
                                 goto finish;
                         }
                 }
 
-                assert(target->meta.load_state == UNIT_LOADED);
+                assert(target->load_state == UNIT_LOADED);
 
                 if (arg_action == ACTION_TEST) {
                         printf("-> By units:\n");
 
                 if (arg_action == ACTION_TEST) {
                         printf("-> By units:\n");
index 6831973..43460f1 100644 (file)
@@ -306,7 +306,7 @@ fail:
 }
 
 static unsigned manager_dispatch_cleanup_queue(Manager *m) {
 }
 
 static unsigned manager_dispatch_cleanup_queue(Manager *m) {
-        Meta *meta;
+        Unit *meta;
         unsigned n = 0;
 
         assert(m);
         unsigned n = 0;
 
         assert(m);
@@ -336,28 +336,28 @@ static void unit_gc_sweep(Unit *u, unsigned gc_marker) {
 
         assert(u);
 
 
         assert(u);
 
-        if (u->meta.gc_marker == gc_marker + GC_OFFSET_GOOD ||
-            u->meta.gc_marker == gc_marker + GC_OFFSET_BAD ||
-            u->meta.gc_marker == gc_marker + GC_OFFSET_IN_PATH)
+        if (u->gc_marker == gc_marker + GC_OFFSET_GOOD ||
+            u->gc_marker == gc_marker + GC_OFFSET_BAD ||
+            u->gc_marker == gc_marker + GC_OFFSET_IN_PATH)
                 return;
 
                 return;
 
-        if (u->meta.in_cleanup_queue)
+        if (u->in_cleanup_queue)
                 goto bad;
 
         if (unit_check_gc(u))
                 goto good;
 
                 goto bad;
 
         if (unit_check_gc(u))
                 goto good;
 
-        u->meta.gc_marker = gc_marker + GC_OFFSET_IN_PATH;
+        u->gc_marker = gc_marker + GC_OFFSET_IN_PATH;
 
         is_bad = true;
 
 
         is_bad = true;
 
-        SET_FOREACH(other, u->meta.dependencies[UNIT_REFERENCED_BY], i) {
+        SET_FOREACH(other, u->dependencies[UNIT_REFERENCED_BY], i) {
                 unit_gc_sweep(other, gc_marker);
 
                 unit_gc_sweep(other, gc_marker);
 
-                if (other->meta.gc_marker == gc_marker + GC_OFFSET_GOOD)
+                if (other->gc_marker == gc_marker + GC_OFFSET_GOOD)
                         goto good;
 
                         goto good;
 
-                if (other->meta.gc_marker != gc_marker + GC_OFFSET_BAD)
+                if (other->gc_marker != gc_marker + GC_OFFSET_BAD)
                         is_bad = false;
         }
 
                         is_bad = false;
         }
 
@@ -366,23 +366,23 @@ static void unit_gc_sweep(Unit *u, unsigned gc_marker) {
 
         /* We were unable to find anything out about this entry, so
          * let's investigate it later */
 
         /* We were unable to find anything out about this entry, so
          * let's investigate it later */
-        u->meta.gc_marker = gc_marker + GC_OFFSET_UNSURE;
+        u->gc_marker = gc_marker + GC_OFFSET_UNSURE;
         unit_add_to_gc_queue(u);
         return;
 
 bad:
         /* We definitely know that this one is not useful anymore, so
          * let's mark it for deletion */
         unit_add_to_gc_queue(u);
         return;
 
 bad:
         /* We definitely know that this one is not useful anymore, so
          * let's mark it for deletion */
-        u->meta.gc_marker = gc_marker + GC_OFFSET_BAD;
+        u->gc_marker = gc_marker + GC_OFFSET_BAD;
         unit_add_to_cleanup_queue(u);
         return;
 
 good:
         unit_add_to_cleanup_queue(u);
         return;
 
 good:
-        u->meta.gc_marker = gc_marker + GC_OFFSET_GOOD;
+        u->gc_marker = gc_marker + GC_OFFSET_GOOD;
 }
 
 static unsigned manager_dispatch_gc_queue(Manager *m) {
 }
 
 static unsigned manager_dispatch_gc_queue(Manager *m) {
-        Meta *meta;
+        Unit *meta;
         unsigned n = 0;
         unsigned gc_marker;
 
         unsigned n = 0;
         unsigned gc_marker;
 
@@ -406,7 +406,7 @@ static unsigned manager_dispatch_gc_queue(Manager *m) {
 
                 unit_gc_sweep((Unit*) meta, gc_marker);
 
 
                 unit_gc_sweep((Unit*) meta, gc_marker);
 
-                LIST_REMOVE(Meta, gc_queue, m->gc_queue, meta);
+                LIST_REMOVE(Unit, gc_queue, m->gc_queue, meta);
                 meta->in_gc_queue = false;
 
                 n++;
                 meta->in_gc_queue = false;
 
                 n++;
@@ -530,7 +530,7 @@ int manager_coldplug(Manager *m) {
         HASHMAP_FOREACH_KEY(u, k, m->units, i) {
 
                 /* ignore aliases */
         HASHMAP_FOREACH_KEY(u, k, m->units, i) {
 
                 /* ignore aliases */
-                if (u->meta.id != k)
+                if (u->id != k)
                         continue;
 
                 if ((q = unit_coldplug(u)) < 0)
                         continue;
 
                 if ((q = unit_coldplug(u)) < 0)
@@ -823,8 +823,8 @@ static int delete_one_unmergeable_job(Manager *m, Job *j) {
                                  * another unit in which case we
                                  * rather remove the start. */
 
                                  * another unit in which case we
                                  * rather remove the start. */
 
-                                log_debug("Looking at job %s/%s conflicted_by=%s", j->unit->meta.id, job_type_to_string(j->type), yes_no(j->type == JOB_STOP && job_is_conflicted_by(j)));
-                                log_debug("Looking at job %s/%s conflicted_by=%s", k->unit->meta.id, job_type_to_string(k->type), yes_no(k->type == JOB_STOP && job_is_conflicted_by(k)));
+                                log_debug("Looking at job %s/%s conflicted_by=%s", j->unit->id, job_type_to_string(j->type), yes_no(j->type == JOB_STOP && job_is_conflicted_by(j)));
+                                log_debug("Looking at job %s/%s conflicted_by=%s", k->unit->id, job_type_to_string(k->type), yes_no(k->type == JOB_STOP && job_is_conflicted_by(k)));
 
                                 if (j->type == JOB_STOP) {
 
 
                                 if (j->type == JOB_STOP) {
 
@@ -850,7 +850,7 @@ static int delete_one_unmergeable_job(Manager *m, Job *j) {
                                 return -ENOEXEC;
 
                         /* Ok, we can drop one, so let's do so. */
                                 return -ENOEXEC;
 
                         /* Ok, we can drop one, so let's do so. */
-                        log_debug("Fixing conflicting jobs by deleting job %s/%s", d->unit->meta.id, job_type_to_string(d->type));
+                        log_debug("Fixing conflicting jobs by deleting job %s/%s", d->unit->id, job_type_to_string(d->type));
                         transaction_delete_job(m, d, true);
                         return 0;
                 }
                         transaction_delete_job(m, d, true);
                         return 0;
                 }
@@ -888,7 +888,7 @@ static int transaction_merge_jobs(Manager *m, DBusError *e) {
 
                         /* We couldn't merge anything. Failure */
                         dbus_set_error(e, BUS_ERROR_TRANSACTION_JOBS_CONFLICTING, "Transaction contains conflicting jobs '%s' and '%s' for %s. Probably contradicting requirement dependencies configured.",
 
                         /* We couldn't merge anything. Failure */
                         dbus_set_error(e, BUS_ERROR_TRANSACTION_JOBS_CONFLICTING, "Transaction contains conflicting jobs '%s' and '%s' for %s. Probably contradicting requirement dependencies configured.",
-                                       job_type_to_string(t), job_type_to_string(k->type), k->unit->meta.id);
+                                       job_type_to_string(t), job_type_to_string(k->type), k->unit->id);
                         return r;
                 }
         }
                         return r;
                 }
         }
@@ -903,8 +903,8 @@ static int transaction_merge_jobs(Manager *m, DBusError *e) {
                         assert_se(job_type_merge(&t, k->type) == 0);
 
                 /* If an active job is mergeable, merge it too */
                         assert_se(job_type_merge(&t, k->type) == 0);
 
                 /* If an active job is mergeable, merge it too */
-                if (j->unit->meta.job)
-                        job_type_merge(&t, j->unit->meta.job->type); /* Might fail. Which is OK */
+                if (j->unit->job)
+                        job_type_merge(&t, j->unit->job->type); /* Might fail. Which is OK */
 
                 while ((k = j->transaction_next)) {
                         if (j->installed) {
 
                 while ((k = j->transaction_next)) {
                         if (j->installed) {
@@ -914,8 +914,8 @@ static int transaction_merge_jobs(Manager *m, DBusError *e) {
                                 transaction_merge_and_delete_job(m, j, k, t);
                 }
 
                                 transaction_merge_and_delete_job(m, j, k, t);
                 }
 
-                if (j->unit->meta.job && !j->installed)
-                        transaction_merge_and_delete_job(m, j, j->unit->meta.job, t);
+                if (j->unit->job && !j->installed)
+                        transaction_merge_and_delete_job(m, j, j->unit->job, t);
 
                 assert(!j->transaction_next);
                 assert(!j->transaction_prev);
 
                 assert(!j->transaction_next);
                 assert(!j->transaction_prev);
@@ -946,7 +946,7 @@ static void transaction_drop_redundant(Manager *m) {
 
                                 if (!job_is_anchor(k) &&
                                     (k->installed || job_type_is_redundant(k->type, unit_active_state(k->unit))) &&
 
                                 if (!job_is_anchor(k) &&
                                     (k->installed || job_type_is_redundant(k->type, unit_active_state(k->unit))) &&
-                                    (!k->unit->meta.job || !job_type_is_conflicting(k->type, k->unit->meta.job->type)))
+                                    (!k->unit->job || !job_type_is_conflicting(k->type, k->unit->job->type)))
                                         continue;
 
                                 changes_something = true;
                                         continue;
 
                                 changes_something = true;
@@ -956,7 +956,7 @@ static void transaction_drop_redundant(Manager *m) {
                         if (changes_something)
                                 continue;
 
                         if (changes_something)
                                 continue;
 
-                        /* log_debug("Found redundant job %s/%s, dropping.", j->unit->meta.id, job_type_to_string(j->type)); */
+                        /* log_debug("Found redundant job %s/%s, dropping.", j->unit->id, job_type_to_string(j->type)); */
                         transaction_delete_job(m, j, false);
                         again = true;
                         break;
                         transaction_delete_job(m, j, false);
                         again = true;
                         break;
@@ -1007,12 +1007,12 @@ static int transaction_verify_order_one(Manager *m, Job *j, Job *from, unsigned
                  * job to remove. We use the marker to find our way
                  * back, since smart how we are we stored our way back
                  * in there. */
                  * job to remove. We use the marker to find our way
                  * back, since smart how we are we stored our way back
                  * in there. */
-                log_warning("Found ordering cycle on %s/%s", j->unit->meta.id, job_type_to_string(j->type));
+                log_warning("Found ordering cycle on %s/%s", j->unit->id, job_type_to_string(j->type));
 
                 delete = NULL;
                 for (k = from; k; k = ((k->generation == generation && k->marker != k) ? k->marker : NULL)) {
 
 
                 delete = NULL;
                 for (k = from; k; k = ((k->generation == generation && k->marker != k) ? k->marker : NULL)) {
 
-                        log_info("Walked on cycle path to %s/%s", k->unit->meta.id, job_type_to_string(k->type));
+                        log_info("Walked on cycle path to %s/%s", k->unit->id, job_type_to_string(k->type));
 
                         if (!delete &&
                             !k->installed &&
 
                         if (!delete &&
                             !k->installed &&
@@ -1030,7 +1030,7 @@ static int transaction_verify_order_one(Manager *m, Job *j, Job *from, unsigned
 
 
                 if (delete) {
 
 
                 if (delete) {
-                        log_warning("Breaking ordering cycle by deleting job %s/%s", delete->unit->meta.id, job_type_to_string(delete->type));
+                        log_warning("Breaking ordering cycle by deleting job %s/%s", delete->unit->id, job_type_to_string(delete->type));
                         transaction_delete_unit(m, delete->unit);
                         return -EAGAIN;
                 }
                         transaction_delete_unit(m, delete->unit);
                         return -EAGAIN;
                 }
@@ -1050,7 +1050,7 @@ static int transaction_verify_order_one(Manager *m, Job *j, Job *from, unsigned
 
         /* We assume that the the dependencies are bidirectional, and
          * hence can ignore UNIT_AFTER */
 
         /* We assume that the the dependencies are bidirectional, and
          * hence can ignore UNIT_AFTER */
-        SET_FOREACH(u, j->unit->meta.dependencies[UNIT_BEFORE], i) {
+        SET_FOREACH(u, j->unit->dependencies[UNIT_BEFORE], i) {
                 Job *o;
 
                 /* Is there a job for this unit? */
                 Job *o;
 
                 /* Is there a job for this unit? */
@@ -1059,7 +1059,7 @@ static int transaction_verify_order_one(Manager *m, Job *j, Job *from, unsigned
                         /* Ok, there is no job for this in the
                          * transaction, but maybe there is already one
                          * running? */
                         /* Ok, there is no job for this in the
                          * transaction, but maybe there is already one
                          * running? */
-                        if (!(o = u->meta.job))
+                        if (!(o = u->job))
                                 continue;
 
                 if ((r = transaction_verify_order_one(m, o, j, generation, e)) < 0)
                                 continue;
 
                 if ((r = transaction_verify_order_one(m, o, j, generation, e)) < 0)
@@ -1110,13 +1110,13 @@ static void transaction_collect_garbage(Manager *m) {
                 HASHMAP_FOREACH(j, m->transaction_jobs, i) {
                         if (j->object_list) {
                                 /* log_debug("Keeping job %s/%s because of %s/%s", */
                 HASHMAP_FOREACH(j, m->transaction_jobs, i) {
                         if (j->object_list) {
                                 /* log_debug("Keeping job %s/%s because of %s/%s", */
-                                /*           j->unit->meta.id, job_type_to_string(j->type), */
-                                /*           j->object_list->subject ? j->object_list->subject->unit->meta.id : "root", */
+                                /*           j->unit->id, job_type_to_string(j->type), */
+                                /*           j->object_list->subject ? j->object_list->subject->unit->id : "root", */
                                 /*           j->object_list->subject ? job_type_to_string(j->object_list->subject->type) : "root"); */
                                 continue;
                         }
 
                                 /*           j->object_list->subject ? job_type_to_string(j->object_list->subject->type) : "root"); */
                                 continue;
                         }
 
-                        /* log_debug("Garbage collecting job %s/%s", j->unit->meta.id, job_type_to_string(j->type)); */
+                        /* log_debug("Garbage collecting job %s/%s", j->unit->id, job_type_to_string(j->type)); */
                         transaction_delete_job(m, j, true);
                         again = true;
                         break;
                         transaction_delete_job(m, j, true);
                         again = true;
                         break;
@@ -1140,9 +1140,9 @@ static int transaction_is_destructive(Manager *m, DBusError *e) {
                 assert(!j->transaction_prev);
                 assert(!j->transaction_next);
 
                 assert(!j->transaction_prev);
                 assert(!j->transaction_next);
 
-                if (j->unit->meta.job &&
-                    j->unit->meta.job != j &&
-                    !job_type_is_superset(j->type, j->unit->meta.job->type)) {
+                if (j->unit->job &&
+                    j->unit->job != j &&
+                    !job_type_is_superset(j->type, j->unit->job->type)) {
 
                         dbus_set_error(e, BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE, "Transaction is destructive.");
                         return -EEXIST;
 
                         dbus_set_error(e, BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE, "Transaction is destructive.");
                         return -EEXIST;
@@ -1181,20 +1181,20 @@ static void transaction_minimize_impact(Manager *m) {
                                         j->type == JOB_STOP && UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(j->unit));
 
                                 changes_existing_job =
                                         j->type == JOB_STOP && UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(j->unit));
 
                                 changes_existing_job =
-                                        j->unit->meta.job &&
-                                        job_type_is_conflicting(j->type, j->unit->meta.job->type);
+                                        j->unit->job &&
+                                        job_type_is_conflicting(j->type, j->unit->job->type);
 
                                 if (!stops_running_service && !changes_existing_job)
                                         continue;
 
                                 if (stops_running_service)
 
                                 if (!stops_running_service && !changes_existing_job)
                                         continue;
 
                                 if (stops_running_service)
-                                        log_debug("%s/%s would stop a running service.", j->unit->meta.id, job_type_to_string(j->type));
+                                        log_debug("%s/%s would stop a running service.", j->unit->id, job_type_to_string(j->type));
 
                                 if (changes_existing_job)
 
                                 if (changes_existing_job)
-                                        log_debug("%s/%s would change existing job.", j->unit->meta.id, job_type_to_string(j->type));
+                                        log_debug("%s/%s would change existing job.", j->unit->id, job_type_to_string(j->type));
 
                                 /* Ok, let's get rid of this */
 
                                 /* Ok, let's get rid of this */
-                                log_debug("Deleting %s/%s to minimize impact.", j->unit->meta.id, job_type_to_string(j->type));
+                                log_debug("Deleting %s/%s to minimize impact.", j->unit->id, job_type_to_string(j->type));
 
                                 transaction_delete_job(m, j, true);
                                 again = true;
 
                                 transaction_delete_job(m, j, true);
                                 again = true;
@@ -1248,14 +1248,14 @@ static int transaction_apply(Manager *m, JobMode mode) {
 
         while ((j = hashmap_steal_first(m->transaction_jobs))) {
                 if (j->installed) {
 
         while ((j = hashmap_steal_first(m->transaction_jobs))) {
                 if (j->installed) {
-                        /* log_debug("Skipping already installed job %s/%s as %u", j->unit->meta.id, job_type_to_string(j->type), (unsigned) j->id); */
+                        /* log_debug("Skipping already installed job %s/%s as %u", j->unit->id, job_type_to_string(j->type), (unsigned) j->id); */
                         continue;
                 }
 
                         continue;
                 }
 
-                if (j->unit->meta.job)
-                        job_free(j->unit->meta.job);
+                if (j->unit->job)
+                        job_free(j->unit->job);
 
 
-                j->unit->meta.job = j;
+                j->unit->job = j;
                 j->installed = true;
                 m->n_installed_jobs ++;
 
                 j->installed = true;
                 m->n_installed_jobs ++;
 
@@ -1269,7 +1269,7 @@ static int transaction_apply(Manager *m, JobMode mode) {
                 job_add_to_dbus_queue(j);
                 job_start_timer(j);
 
                 job_add_to_dbus_queue(j);
                 job_start_timer(j);
 
-                log_debug("Installed new job %s/%s as %u", j->unit->meta.id, job_type_to_string(j->type), (unsigned) j->id);
+                log_debug("Installed new job %s/%s as %u", j->unit->id, job_type_to_string(j->type), (unsigned) j->id);
         }
 
         /* As last step, kill all remaining job dependencies. */
         }
 
         /* As last step, kill all remaining job dependencies. */
@@ -1399,8 +1399,8 @@ static Job* transaction_add_one_job(Manager *m, JobType type, Unit *unit, bool o
                 }
         }
 
                 }
         }
 
-        if (unit->meta.job && unit->meta.job->type == type)
-                j = unit->meta.job;
+        if (unit->job && unit->job->type == type)
+                j = unit->job;
         else if (!(j = job_new(m, type, unit)))
                 return NULL;
 
         else if (!(j = job_new(m, type, unit)))
                 return NULL;
 
@@ -1419,7 +1419,7 @@ static Job* transaction_add_one_job(Manager *m, JobType type, Unit *unit, bool o
         if (is_new)
                 *is_new = true;
 
         if (is_new)
                 *is_new = true;
 
-        /* log_debug("Added job %s/%s to transaction.", unit->meta.id, job_type_to_string(type)); */
+        /* log_debug("Added job %s/%s to transaction.", unit->id, job_type_to_string(type)); */
 
         return j;
 }
 
         return j;
 }
@@ -1450,8 +1450,8 @@ void manager_transaction_unlink_job(Manager *m, Job *j, bool delete_dependencies
 
                 if (other && delete_dependencies) {
                         log_debug("Deleting job %s/%s as dependency of job %s/%s",
 
                 if (other && delete_dependencies) {
                         log_debug("Deleting job %s/%s as dependency of job %s/%s",
-                                  other->unit->meta.id, job_type_to_string(other->type),
-                                  j->unit->meta.id, job_type_to_string(j->type));
+                                  other->unit->id, job_type_to_string(other->type),
+                                  j->unit->id, job_type_to_string(j->type));
                         transaction_delete_job(m, other, delete_dependencies);
                 }
         }
                         transaction_delete_job(m, other, delete_dependencies);
                 }
         }
@@ -1480,34 +1480,34 @@ static int transaction_add_job_and_dependencies(
         assert(unit);
 
         /* log_debug("Pulling in %s/%s from %s/%s", */
         assert(unit);
 
         /* log_debug("Pulling in %s/%s from %s/%s", */
-        /*           unit->meta.id, job_type_to_string(type), */
-        /*           by ? by->unit->meta.id : "NA", */
+        /*           unit->id, job_type_to_string(type), */
+        /*           by ? by->unit->id : "NA", */
         /*           by ? job_type_to_string(by->type) : "NA"); */
 
         /*           by ? job_type_to_string(by->type) : "NA"); */
 
-        if (unit->meta.load_state != UNIT_LOADED &&
-            unit->meta.load_state != UNIT_ERROR &&
-            unit->meta.load_state != UNIT_MASKED) {
-                dbus_set_error(e, BUS_ERROR_LOAD_FAILED, "Unit %s is not loaded properly.", unit->meta.id);
+        if (unit->load_state != UNIT_LOADED &&
+            unit->load_state != UNIT_ERROR &&
+            unit->load_state != UNIT_MASKED) {
+                dbus_set_error(e, BUS_ERROR_LOAD_FAILED, "Unit %s is not loaded properly.", unit->id);
                 return -EINVAL;
         }
 
                 return -EINVAL;
         }
 
-        if (type != JOB_STOP && unit->meta.load_state == UNIT_ERROR) {
+        if (type != JOB_STOP && unit->load_state == UNIT_ERROR) {
                 dbus_set_error(e, BUS_ERROR_LOAD_FAILED,
                                "Unit %s failed to load: %s. "
                                "See system logs and 'systemctl status %s' for details.",
                 dbus_set_error(e, BUS_ERROR_LOAD_FAILED,
                                "Unit %s failed to load: %s. "
                                "See system logs and 'systemctl status %s' for details.",
-                               unit->meta.id,
-                               strerror(-unit->meta.load_error),
-                               unit->meta.id);
+                               unit->id,
+                               strerror(-unit->load_error),
+                               unit->id);
                 return -EINVAL;
         }
 
                 return -EINVAL;
         }
 
-        if (type != JOB_STOP && unit->meta.load_state == UNIT_MASKED) {
-                dbus_set_error(e, BUS_ERROR_MASKED, "Unit %s is masked.", unit->meta.id);
+        if (type != JOB_STOP && unit->load_state == UNIT_MASKED) {
+                dbus_set_error(e, BUS_ERROR_MASKED, "Unit %s is masked.", unit->id);
                 return -EINVAL;
         }
 
         if (!unit_job_is_applicable(unit, type)) {
                 return -EINVAL;
         }
 
         if (!unit_job_is_applicable(unit, type)) {
-                dbus_set_error(e, BUS_ERROR_JOB_TYPE_NOT_APPLICABLE, "Job type %s is not applicable for unit %s.", job_type_to_string(type), unit->meta.id);
+                dbus_set_error(e, BUS_ERROR_JOB_TYPE_NOT_APPLICABLE, "Job type %s is not applicable for unit %s.", job_type_to_string(type), unit->id);
                 return -EBADR;
         }
 
                 return -EBADR;
         }
 
@@ -1529,7 +1529,7 @@ static int transaction_add_job_and_dependencies(
                 if (unit_following_set(ret->unit, &following) > 0) {
                         SET_FOREACH(dep, following, i)
                                 if ((r = transaction_add_job_and_dependencies(m, type, dep, ret, false, override, false, false, ignore_order, e, NULL)) < 0) {
                 if (unit_following_set(ret->unit, &following) > 0) {
                         SET_FOREACH(dep, following, i)
                                 if ((r = transaction_add_job_and_dependencies(m, type, dep, ret, false, override, false, false, ignore_order, e, NULL)) < 0) {
-                                        log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->meta.id, bus_error(e, r));
+                                        log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
 
                                         if (e)
                                                 dbus_error_free(e);
 
                                         if (e)
                                                 dbus_error_free(e);
@@ -1540,7 +1540,7 @@ static int transaction_add_job_and_dependencies(
 
                 /* Finally, recursively add in all dependencies. */
                 if (type == JOB_START || type == JOB_RELOAD_OR_START) {
 
                 /* Finally, recursively add in all dependencies. */
                 if (type == JOB_START || type == JOB_RELOAD_OR_START) {
-                        SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_REQUIRES], i)
+                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_REQUIRES], i)
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_START, dep, ret, true, override, false, false, ignore_order, e, NULL)) < 0) {
                                         if (r != -EBADR)
                                                 goto fail;
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_START, dep, ret, true, override, false, false, ignore_order, e, NULL)) < 0) {
                                         if (r != -EBADR)
                                                 goto fail;
@@ -1549,7 +1549,7 @@ static int transaction_add_job_and_dependencies(
                                                 dbus_error_free(e);
                                 }
 
                                                 dbus_error_free(e);
                                 }
 
-                        SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_BIND_TO], i)
+                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_BIND_TO], i)
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_START, dep, ret, true, override, false, false, ignore_order, e, NULL)) < 0) {
 
                                         if (r != -EBADR)
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_START, dep, ret, true, override, false, false, ignore_order, e, NULL)) < 0) {
 
                                         if (r != -EBADR)
@@ -1559,23 +1559,23 @@ static int transaction_add_job_and_dependencies(
                                                 dbus_error_free(e);
                                 }
 
                                                 dbus_error_free(e);
                                 }
 
-                        SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_REQUIRES_OVERRIDABLE], i)
+                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_REQUIRES_OVERRIDABLE], i)
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_START, dep, ret, !override, override, false, false, ignore_order, e, NULL)) < 0) {
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_START, dep, ret, !override, override, false, false, ignore_order, e, NULL)) < 0) {
-                                        log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->meta.id, bus_error(e, r));
+                                        log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
 
                                         if (e)
                                                 dbus_error_free(e);
                                 }
 
 
                                         if (e)
                                                 dbus_error_free(e);
                                 }
 
-                        SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_WANTS], i)
+                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_WANTS], i)
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_START, dep, ret, false, false, false, false, ignore_order, e, NULL)) < 0) {
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_START, dep, ret, false, false, false, false, ignore_order, e, NULL)) < 0) {
-                                        log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->meta.id, bus_error(e, r));
+                                        log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
 
                                         if (e)
                                                 dbus_error_free(e);
                                 }
 
 
                                         if (e)
                                                 dbus_error_free(e);
                                 }
 
-                        SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_REQUISITE], i)
+                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_REQUISITE], i)
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_VERIFY_ACTIVE, dep, ret, true, override, false, false, ignore_order, e, NULL)) < 0) {
 
                                         if (r != -EBADR)
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_VERIFY_ACTIVE, dep, ret, true, override, false, false, ignore_order, e, NULL)) < 0) {
 
                                         if (r != -EBADR)
@@ -1585,15 +1585,15 @@ static int transaction_add_job_and_dependencies(
                                                 dbus_error_free(e);
                                 }
 
                                                 dbus_error_free(e);
                                 }
 
-                        SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_REQUISITE_OVERRIDABLE], i)
+                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_REQUISITE_OVERRIDABLE], i)
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_VERIFY_ACTIVE, dep, ret, !override, override, false, false, ignore_order, e, NULL)) < 0) {
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_VERIFY_ACTIVE, dep, ret, !override, override, false, false, ignore_order, e, NULL)) < 0) {
-                                        log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->meta.id, bus_error(e, r));
+                                        log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
 
                                         if (e)
                                                 dbus_error_free(e);
                                 }
 
 
                                         if (e)
                                                 dbus_error_free(e);
                                 }
 
-                        SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_CONFLICTS], i)
+                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_CONFLICTS], i)
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_STOP, dep, ret, true, override, true, false, ignore_order, e, NULL)) < 0) {
 
                                         if (r != -EBADR)
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_STOP, dep, ret, true, override, true, false, ignore_order, e, NULL)) < 0) {
 
                                         if (r != -EBADR)
@@ -1603,9 +1603,9 @@ static int transaction_add_job_and_dependencies(
                                                 dbus_error_free(e);
                                 }
 
                                                 dbus_error_free(e);
                                 }
 
-                        SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_CONFLICTED_BY], i)
+                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_CONFLICTED_BY], i)
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_STOP, dep, ret, false, override, false, false, ignore_order, e, NULL)) < 0) {
                                 if ((r = transaction_add_job_and_dependencies(m, JOB_STOP, dep, ret, false, override, false, false, ignore_order, e, NULL)) < 0) {
-                                        log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->meta.id, bus_error(e, r));
+                                        log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
 
                                         if (e)
                                                 dbus_error_free(e);
 
                                         if (e)
                                                 dbus_error_free(e);
@@ -1615,7 +1615,7 @@ static int transaction_add_job_and_dependencies(
 
                 if (type == JOB_STOP || type == JOB_RESTART || type == JOB_TRY_RESTART) {
 
 
                 if (type == JOB_STOP || type == JOB_RESTART || type == JOB_TRY_RESTART) {
 
-                        SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_REQUIRED_BY], i)
+                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_REQUIRED_BY], i)
                                 if ((r = transaction_add_job_and_dependencies(m, type, dep, ret, true, override, false, false, ignore_order, e, NULL)) < 0) {
 
                                         if (r != -EBADR)
                                 if ((r = transaction_add_job_and_dependencies(m, type, dep, ret, true, override, false, false, ignore_order, e, NULL)) < 0) {
 
                                         if (r != -EBADR)
@@ -1625,7 +1625,7 @@ static int transaction_add_job_and_dependencies(
                                                 dbus_error_free(e);
                                 }
 
                                                 dbus_error_free(e);
                                 }
 
-                        SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_BOUND_BY], i)
+                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_BOUND_BY], i)
                                 if ((r = transaction_add_job_and_dependencies(m, type, dep, ret, true, override, false, false, ignore_order, e, NULL)) < 0) {
 
                                         if (r != -EBADR)
                                 if ((r = transaction_add_job_and_dependencies(m, type, dep, ret, true, override, false, false, ignore_order, e, NULL)) < 0) {
 
                                         if (r != -EBADR)
@@ -1638,11 +1638,11 @@ static int transaction_add_job_and_dependencies(
 
                 if (type == JOB_RELOAD || type == JOB_RELOAD_OR_START) {
 
 
                 if (type == JOB_RELOAD || type == JOB_RELOAD_OR_START) {
 
-                        SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_PROPAGATE_RELOAD_TO], i) {
+                        SET_FOREACH(dep, ret->unit->dependencies[UNIT_PROPAGATE_RELOAD_TO], i) {
                                 r = transaction_add_job_and_dependencies(m, JOB_RELOAD, dep, ret, false, override, false, false, ignore_order, e, NULL);
 
                                 if (r < 0) {
                                 r = transaction_add_job_and_dependencies(m, JOB_RELOAD, dep, ret, false, override, false, false, ignore_order, e, NULL);
 
                                 if (r < 0) {
-                                        log_warning("Cannot add dependency reload job for unit %s, ignoring: %s", dep->meta.id, bus_error(e, r));
+                                        log_warning("Cannot add dependency reload job for unit %s, ignoring: %s", dep->id, bus_error(e, r));
 
                                         if (e)
                                                 dbus_error_free(e);
 
                                         if (e)
                                                 dbus_error_free(e);
@@ -1673,14 +1673,14 @@ static int transaction_add_isolate_jobs(Manager *m) {
         HASHMAP_FOREACH_KEY(u, k, m->units, i) {
 
                 /* ignore aliases */
         HASHMAP_FOREACH_KEY(u, k, m->units, i) {
 
                 /* ignore aliases */
-                if (u->meta.id != k)
+                if (u->id != k)
                         continue;
 
                         continue;
 
-                if (u->meta.ignore_on_isolate)
+                if (u->ignore_on_isolate)
                         continue;
 
                 /* No need to stop inactive jobs */
                         continue;
 
                 /* No need to stop inactive jobs */
-                if (UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(u)) && !u->meta.job)
+                if (UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(u)) && !u->job)
                         continue;
 
                 /* Is there already something listed for this? */
                         continue;
 
                 /* Is there already something listed for this? */
@@ -1688,7 +1688,7 @@ static int transaction_add_isolate_jobs(Manager *m) {
                         continue;
 
                 if ((r = transaction_add_job_and_dependencies(m, JOB_STOP, u, NULL, true, false, false, false, false, NULL, NULL)) < 0)
                         continue;
 
                 if ((r = transaction_add_job_and_dependencies(m, JOB_STOP, u, NULL, true, false, false, false, false, NULL, NULL)) < 0)
-                        log_warning("Cannot add isolate job for unit %s, ignoring: %s", u->meta.id, strerror(-r));
+                        log_warning("Cannot add isolate job for unit %s, ignoring: %s", u->id, strerror(-r));
         }
 
         return 0;
         }
 
         return 0;
@@ -1708,12 +1708,12 @@ int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool ove
                 return -EINVAL;
         }
 
                 return -EINVAL;
         }
 
-        if (mode == JOB_ISOLATE && !unit->meta.allow_isolate) {
+        if (mode == JOB_ISOLATE && !unit->allow_isolate) {
                 dbus_set_error(e, BUS_ERROR_NO_ISOLATION, "Operation refused, unit may not be isolated.");
                 return -EPERM;
         }
 
                 dbus_set_error(e, BUS_ERROR_NO_ISOLATION, "Operation refused, unit may not be isolated.");
                 return -EPERM;
         }
 
-        log_debug("Trying to enqueue job %s/%s/%s", unit->meta.id, job_type_to_string(type), job_mode_to_string(mode));
+        log_debug("Trying to enqueue job %s/%s/%s", unit->id, job_type_to_string(type), job_mode_to_string(mode));
 
         if ((r = transaction_add_job_and_dependencies(m, type, unit, NULL, true, override, false,
                                                       mode == JOB_IGNORE_DEPENDENCIES || mode == JOB_IGNORE_REQUIREMENTS,
 
         if ((r = transaction_add_job_and_dependencies(m, type, unit, NULL, true, override, false,
                                                       mode == JOB_IGNORE_DEPENDENCIES || mode == JOB_IGNORE_REQUIREMENTS,
@@ -1731,7 +1731,7 @@ int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool ove
         if ((r = transaction_activate(m, mode, e)) < 0)
                 return r;
 
         if ((r = transaction_activate(m, mode, e)) < 0)
                 return r;
 
-        log_debug("Enqueued job %s/%s as %u", unit->meta.id, job_type_to_string(type), (unsigned) ret->id);
+        log_debug("Enqueued job %s/%s as %u", unit->id, job_type_to_string(type), (unsigned) ret->id);
 
         if (_ret)
                 *_ret = ret;
 
         if (_ret)
                 *_ret = ret;
@@ -1768,7 +1768,7 @@ Unit *manager_get_unit(Manager *m, const char *name) {
 }
 
 unsigned manager_dispatch_load_queue(Manager *m) {
 }
 
 unsigned manager_dispatch_load_queue(Manager *m) {
-        Meta *meta;
+        Unit *meta;
         unsigned n = 0;
 
         assert(m);
         unsigned n = 0;
 
         assert(m);
@@ -1830,8 +1830,8 @@ int manager_load_unit_prepare(Manager *m, const char *name, const char *path, DB
                 return -ENOMEM;
 
         if (path) {
                 return -ENOMEM;
 
         if (path) {
-                ret->meta.fragment_path = strdup(path);
-                if (!ret->meta.fragment_path) {
+                ret->fragment_path = strdup(path);
+                if (!ret->fragment_path) {
                         unit_free(ret);
                         return -ENOMEM;
                 }
                         unit_free(ret);
                         return -ENOMEM;
                 }
@@ -1891,7 +1891,7 @@ void manager_dump_units(Manager *s, FILE *f, const char *prefix) {
         assert(f);
 
         HASHMAP_FOREACH_KEY(u, t, s->units, i)
         assert(f);
 
         HASHMAP_FOREACH_KEY(u, t, s->units, i)
-                if (u->meta.id == t)
+                if (u->id == t)
                         unit_dump(u, f, prefix);
 }
 
                         unit_dump(u, f, prefix);
 }
 
@@ -1929,7 +1929,7 @@ unsigned manager_dispatch_run_queue(Manager *m) {
 
 unsigned manager_dispatch_dbus_queue(Manager *m) {
         Job *j;
 
 unsigned manager_dispatch_dbus_queue(Manager *m) {
         Job *j;
-        Meta *meta;
+        Unit *meta;
         unsigned n = 0;
 
         assert(m);
         unsigned n = 0;
 
         assert(m);
@@ -2016,7 +2016,7 @@ static int manager_process_notify_fd(Manager *m) {
                 if (!(tags = strv_split(buf, "\n\r")))
                         return -ENOMEM;
 
                 if (!(tags = strv_split(buf, "\n\r")))
                         return -ENOMEM;
 
-                log_debug("Got notification message for unit %s", u->meta.id);
+                log_debug("Got notification message for unit %s", u->id);
 
                 if (UNIT_VTABLE(u)->notify_message)
                         UNIT_VTABLE(u)->notify_message(u, ucred->pid, tags);
 
                 if (UNIT_VTABLE(u)->notify_message)
                         UNIT_VTABLE(u)->notify_message(u, ucred->pid, tags);
@@ -2095,7 +2095,7 @@ static int manager_dispatch_sigchld(Manager *m) {
                 if (!u)
                         continue;
 
                 if (!u)
                         continue;
 
-                log_debug("Child %lu belongs to %s", (long unsigned) si.si_pid, u->meta.id);
+                log_debug("Child %lu belongs to %s", (long unsigned) si.si_pid, u->id);
 
                 hashmap_remove(m->watch_pids, LONG_TO_PTR(si.si_pid));
                 UNIT_VTABLE(u)->sigchld_event(u, si.si_pid, si.si_code, si.si_status);
 
                 hashmap_remove(m->watch_pids, LONG_TO_PTR(si.si_pid));
                 UNIT_VTABLE(u)->sigchld_event(u, si.si_pid, si.si_code, si.si_status);
@@ -2559,10 +2559,10 @@ void manager_send_unit_audit(Manager *m, Unit *u, int type, bool success) {
         if (m->running_as != MANAGER_SYSTEM)
                 return;
 
         if (m->running_as != MANAGER_SYSTEM)
                 return;
 
-        if (u->meta.type != UNIT_SERVICE)
+        if (u->type != UNIT_SERVICE)
                 return;
 
                 return;
 
-        if (!(p = unit_name_to_prefix_and_instance(u->meta.id))) {
+        if (!(p = unit_name_to_prefix_and_instance(u->id))) {
                 log_error("Failed to allocate unit name for audit message: %s", strerror(ENOMEM));
                 return;
         }
                 log_error("Failed to allocate unit name for audit message: %s", strerror(ENOMEM));
                 return;
         }
@@ -2600,9 +2600,9 @@ void manager_send_unit_plymouth(Manager *m, Unit *u) {
         if (m->running_as != MANAGER_SYSTEM)
                 return;
 
         if (m->running_as != MANAGER_SYSTEM)
                 return;
 
-        if (u->meta.type != UNIT_SERVICE &&
-            u->meta.type != UNIT_MOUNT &&
-            u->meta.type != UNIT_SWAP)
+        if (u->type != UNIT_SERVICE &&
+            u->type != UNIT_MOUNT &&
+            u->type != UNIT_SWAP)
                 return;
 
         /* We set SOCK_NONBLOCK here so that we rather drop the
                 return;
 
         /* We set SOCK_NONBLOCK here so that we rather drop the
@@ -2628,7 +2628,7 @@ void manager_send_unit_plymouth(Manager *m, Unit *u) {
                 goto finish;
         }
 
                 goto finish;
         }
 
-        if (asprintf(&message, "U\002%c%s%n", (int) (strlen(u->meta.id) + 1), u->meta.id, &n) < 0) {
+        if (asprintf(&message, "U\002%c%s%n", (int) (strlen(u->id) + 1), u->id, &n) < 0) {
                 log_error("Out of memory");
                 goto finish;
         }
                 log_error("Out of memory");
                 goto finish;
         }
@@ -2748,14 +2748,14 @@ int manager_serialize(Manager *m, FILE *f, FDSet *fds) {
         fputc('\n', f);
 
         HASHMAP_FOREACH_KEY(u, t, m->units, i) {
         fputc('\n', f);
 
         HASHMAP_FOREACH_KEY(u, t, m->units, i) {
-                if (u->meta.id != t)
+                if (u->id != t)
                         continue;
 
                 if (!unit_can_serialize(u))
                         continue;
 
                 /* Start marker */
                         continue;
 
                 if (!unit_can_serialize(u))
                         continue;
 
                 /* Start marker */
-                fputs(u->meta.id, f);
+                fputs(u->id, f);
                 fputc('\n', f);
 
                 if ((r = unit_serialize(u, f, fds)) < 0) {
                 fputc('\n', f);
 
                 if ((r = unit_serialize(u, f, fds)) < 0) {
@@ -2946,7 +2946,7 @@ bool manager_is_booting_or_shutting_down(Manager *m) {
         /* Is there a job for the shutdown target? */
         u = manager_get_unit(m, SPECIAL_SHUTDOWN_TARGET);
         if (u)
         /* Is there a job for the shutdown target? */
         u = manager_get_unit(m, SPECIAL_SHUTDOWN_TARGET);
         if (u)
-                return !!u->meta.job;
+                return !!u->job;
 
         return false;
 }
 
         return false;
 }
index 0ace0c9..5e65fdb 100644 (file)
@@ -74,7 +74,7 @@ struct Watch {
         int fd;
         WatchType type;
         union {
         int fd;
         WatchType type;
         union {
-                union Unit *unit;
+                struct Unit *unit;
                 struct Job *job;
                 DBusWatch *bus_watch;
                 DBusTimeout *bus_timeout;
                 struct Job *job;
                 DBusWatch *bus_watch;
                 DBusTimeout *bus_timeout;
@@ -102,10 +102,10 @@ struct Manager {
 
         /* To make it easy to iterate through the units of a specific
          * type we maintain a per type linked list */
 
         /* To make it easy to iterate through the units of a specific
          * type we maintain a per type linked list */
-        LIST_HEAD(Meta, units_by_type[_UNIT_TYPE_MAX]);
+        LIST_HEAD(Unit, units_by_type[_UNIT_TYPE_MAX]);
 
         /* Units that need to be loaded */
 
         /* Units that need to be loaded */
-        LIST_HEAD(Meta, load_queue); /* this is actually more a stack than a queue, but uh. */
+        LIST_HEAD(Unit, load_queue); /* this is actually more a stack than a queue, but uh. */
 
         /* Jobs that need to be run */
         LIST_HEAD(Job, run_queue);   /* more a stack than a queue, too */
 
         /* Jobs that need to be run */
         LIST_HEAD(Job, run_queue);   /* more a stack than a queue, too */
@@ -114,14 +114,14 @@ struct Manager {
          * D-Bus. When something about a job changes it is added here
          * if it is not in there yet. This allows easy coalescing of
          * D-Bus change signals. */
          * D-Bus. When something about a job changes it is added here
          * if it is not in there yet. This allows easy coalescing of
          * D-Bus change signals. */
-        LIST_HEAD(Meta, dbus_unit_queue);
+        LIST_HEAD(Unit, dbus_unit_queue);
         LIST_HEAD(Job, dbus_job_queue);
 
         /* Units to remove */
         LIST_HEAD(Job, dbus_job_queue);
 
         /* Units to remove */
-        LIST_HEAD(Meta, cleanup_queue);
+        LIST_HEAD(Unit, cleanup_queue);
 
         /* Units to check when doing GC */
 
         /* Units to check when doing GC */
-        LIST_HEAD(Meta, gc_queue);
+        LIST_HEAD(Unit, gc_queue);
 
         /* Jobs to be added */
         Hashmap *transaction_jobs;      /* Unit object => Job object list 1:1 */
 
         /* Jobs to be added */
         Hashmap *transaction_jobs;      /* Unit object => Job object list 1:1 */
index f94c0eb..9f7ce69 100644 (file)
@@ -59,7 +59,7 @@ static void mount_init(Unit *u) {
         Mount *m = MOUNT(u);
 
         assert(u);
         Mount *m = MOUNT(u);
 
         assert(u);
-        assert(u->meta.load_state == UNIT_STUB);
+        assert(u->load_state == UNIT_STUB);
 
         m->timeout_usec = DEFAULT_TIMEOUT_USEC;
         m->directory_mode = 0755;
 
         m->timeout_usec = DEFAULT_TIMEOUT_USEC;
         m->directory_mode = 0755;
@@ -69,8 +69,8 @@ static void mount_init(Unit *u) {
         /* The stdio/kmsg bridge socket is on /, in order to avoid a
          * dep loop, don't use kmsg logging for -.mount */
         if (!unit_has_name(u, "-.mount")) {
         /* The stdio/kmsg bridge socket is on /, in order to avoid a
          * dep loop, don't use kmsg logging for -.mount */
         if (!unit_has_name(u, "-.mount")) {
-                m->exec_context.std_output = u->meta.manager->default_std_output;
-                m->exec_context.std_error = u->meta.manager->default_std_error;
+                m->exec_context.std_output = u->manager->default_std_output;
+                m->exec_context.std_error = u->manager->default_std_error;
         }
 
         /* We need to make sure that /bin/mount is always called in
         }
 
         /* We need to make sure that /bin/mount is always called in
@@ -148,7 +148,7 @@ static MountParameters* get_mount_parameters(Mount *m) {
 }
 
 static int mount_add_mount_links(Mount *m) {
 }
 
 static int mount_add_mount_links(Mount *m) {
-        Meta *other;
+        Unit *other;
         int r;
         MountParameters *pm;
 
         int r;
         MountParameters *pm;
 
@@ -211,7 +211,7 @@ static int mount_add_mount_links(Mount *m) {
 }
 
 static int mount_add_swap_links(Mount *m) {
 }
 
 static int mount_add_swap_links(Mount *m) {
-        Meta *other;
+        Unit *other;
         int r;
 
         assert(m);
         int r;
 
         assert(m);
@@ -224,7 +224,7 @@ static int mount_add_swap_links(Mount *m) {
 }
 
 static int mount_add_path_links(Mount *m) {
 }
 
 static int mount_add_path_links(Mount *m) {
-        Meta *other;
+        Unit *other;
         int r;
 
         assert(m);
         int r;
 
         assert(m);
@@ -237,7 +237,7 @@ static int mount_add_path_links(Mount *m) {
 }
 
 static int mount_add_automount_links(Mount *m) {
 }
 
 static int mount_add_automount_links(Mount *m) {
-        Meta *other;
+        Unit *other;
         int r;
 
         assert(m);
         int r;
 
         assert(m);
@@ -250,7 +250,7 @@ static int mount_add_automount_links(Mount *m) {
 }
 
 static int mount_add_socket_links(Mount *m) {
 }
 
 static int mount_add_socket_links(Mount *m) {
-        Meta *other;
+        Unit *other;
         int r;
 
         assert(m);
         int r;
 
         assert(m);
@@ -382,9 +382,9 @@ static int mount_add_fstab_links(Mount *m) {
 
                 /* Install automount unit */
                 if (!nofail) /* automount + fail */
 
                 /* Install automount unit */
                 if (!nofail) /* automount + fail */
-                        return unit_add_two_dependencies(tu, UNIT_AFTER, UNIT_REQUIRES, UNIT(am), true);
+                        return unit_add_two_dependencies(tu, UNIT_AFTER, UNIT_REQUIRES, am, true);
                 else /* automount + nofail */
                 else /* automount + nofail */
-                        return unit_add_two_dependencies(tu, UNIT_AFTER, UNIT_WANTS, UNIT(am), true);
+                        return unit_add_two_dependencies(tu, UNIT_AFTER, UNIT_WANTS, am, true);
 
         } else if (handle && !noauto) {
 
 
         } else if (handle && !noauto) {
 
@@ -422,13 +422,13 @@ static int mount_add_device_links(Mount *m) {
 
                 if ((r = unit_add_node_link(UNIT(m), p->what,
                                             !noauto && nofail &&
 
                 if ((r = unit_add_node_link(UNIT(m), p->what,
                                             !noauto && nofail &&
-                                            UNIT(m)->meta.manager->running_as == MANAGER_SYSTEM)) < 0)
+                                            UNIT(m)->manager->running_as == MANAGER_SYSTEM)) < 0)
                         return r;
         }
 
         if (p->passno > 0 &&
             !mount_is_bind(p) &&
                         return r;
         }
 
         if (p->passno > 0 &&
             !mount_is_bind(p) &&
-            UNIT(m)->meta.manager->running_as == MANAGER_SYSTEM &&
+            UNIT(m)->manager->running_as == MANAGER_SYSTEM &&
             !path_equal(m->where, "/")) {
                 char *name;
                 Unit *fsck;
             !path_equal(m->where, "/")) {
                 char *name;
                 Unit *fsck;
@@ -517,10 +517,10 @@ static int mount_fix_timeouts(Mount *m) {
         }
 
         SET_FOREACH(other, m->meta.dependencies[UNIT_AFTER], i) {
         }
 
         SET_FOREACH(other, m->meta.dependencies[UNIT_AFTER], i) {
-                if (other->meta.type != UNIT_DEVICE)
+                if (other->type != UNIT_DEVICE)
                         continue;
 
                         continue;
 
-                other->meta.job_timeout = u;
+                other->job_timeout = u;
         }
 
         return 0;
         }
 
         return 0;
@@ -571,13 +571,13 @@ static int mount_load(Unit *u) {
         int r;
 
         assert(u);
         int r;
 
         assert(u);
-        assert(u->meta.load_state == UNIT_STUB);
+        assert(u->load_state == UNIT_STUB);
 
         if ((r = unit_load_fragment_and_dropin_optional(u)) < 0)
                 return r;
 
         /* This is a new unit? Then let's add in some extras */
 
         if ((r = unit_load_fragment_and_dropin_optional(u)) < 0)
                 return r;
 
         /* This is a new unit? Then let's add in some extras */
-        if (u->meta.load_state == UNIT_LOADED) {
+        if (u->load_state == UNIT_LOADED) {
                 if ((r = unit_add_exec_dependencies(u, &m->exec_context)) < 0)
                         return r;
 
                 if ((r = unit_add_exec_dependencies(u, &m->exec_context)) < 0)
                         return r;
 
@@ -585,7 +585,7 @@ static int mount_load(Unit *u) {
                         m->from_fragment = true;
 
                 if (!m->where)
                         m->from_fragment = true;
 
                 if (!m->where)
-                        if (!(m->where = unit_name_to_path(u->meta.id)))
+                        if (!(m->where = unit_name_to_path(u->id)))
                                 return -ENOMEM;
 
                 path_kill_slashes(m->where);
                                 return -ENOMEM;
 
                 path_kill_slashes(m->where);
@@ -636,7 +636,7 @@ static int mount_notify_automount(Mount *m, int status) {
         assert(m);
 
         SET_FOREACH(p, m->meta.dependencies[UNIT_TRIGGERED_BY], i)
         assert(m);
 
         SET_FOREACH(p, m->meta.dependencies[UNIT_TRIGGERED_BY], i)
-                if (p->meta.type == UNIT_AUTOMOUNT) {
+                if (p->type == UNIT_AUTOMOUNT) {
                          r = automount_send_ready(AUTOMOUNT(p), status);
                          if (r < 0)
                                  return r;
                          r = automount_send_ready(AUTOMOUNT(p), status);
                          if (r < 0)
                                  return r;
@@ -1220,7 +1220,7 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) {
         }
 
         log_full(success ? LOG_DEBUG : LOG_NOTICE,
         }
 
         log_full(success ? LOG_DEBUG : LOG_NOTICE,
-                 "%s mount process exited, code=%s status=%i", u->meta.id, sigchld_code_to_string(code), status);
+                 "%s mount process exited, code=%s status=%i", u->id, sigchld_code_to_string(code), status);
 
         /* Note that mount(8) returning and the kernel sending us a
          * mount table change event might happen out-of-order. If an
 
         /* Note that mount(8) returning and the kernel sending us a
          * mount table change event might happen out-of-order. If an
@@ -1287,27 +1287,27 @@ static void mount_timer_event(Unit *u, uint64_t elapsed, Watch *w) {
 
         case MOUNT_MOUNTING:
         case MOUNT_MOUNTING_DONE:
 
         case MOUNT_MOUNTING:
         case MOUNT_MOUNTING_DONE:
-                log_warning("%s mounting timed out. Stopping.", u->meta.id);
+                log_warning("%s mounting timed out. Stopping.", u->id);
                 mount_enter_signal(m, MOUNT_MOUNTING_SIGTERM, false);
                 break;
 
         case MOUNT_REMOUNTING:
                 mount_enter_signal(m, MOUNT_MOUNTING_SIGTERM, false);
                 break;
 
         case MOUNT_REMOUNTING:
-                log_warning("%s remounting timed out. Stopping.", u->meta.id);
+                log_warning("%s remounting timed out. Stopping.", u->id);
                 m->reload_failure = true;
                 mount_enter_mounted(m, true);
                 break;
 
         case MOUNT_UNMOUNTING:
                 m->reload_failure = true;
                 mount_enter_mounted(m, true);
                 break;
 
         case MOUNT_UNMOUNTING:
-                log_warning("%s unmounting timed out. Stopping.", u->meta.id);
+                log_warning("%s unmounting timed out. Stopping.", u->id);
                 mount_enter_signal(m, MOUNT_UNMOUNTING_SIGTERM, false);
                 break;
 
         case MOUNT_MOUNTING_SIGTERM:
                 if (m->exec_context.send_sigkill) {
                 mount_enter_signal(m, MOUNT_UNMOUNTING_SIGTERM, false);
                 break;
 
         case MOUNT_MOUNTING_SIGTERM:
                 if (m->exec_context.send_sigkill) {
-                        log_warning("%s mounting timed out. Killing.", u->meta.id);
+                        log_warning("%s mounting timed out. Killing.", u->id);
                         mount_enter_signal(m, MOUNT_MOUNTING_SIGKILL, false);
                 } else {
                         mount_enter_signal(m, MOUNT_MOUNTING_SIGKILL, false);
                 } else {
-                        log_warning("%s mounting timed out. Skipping SIGKILL. Ignoring.", u->meta.id);
+                        log_warning("%s mounting timed out. Skipping SIGKILL. Ignoring.", u->id);
 
                         if (m->from_proc_self_mountinfo)
                                 mount_enter_mounted(m, false);
 
                         if (m->from_proc_self_mountinfo)
                                 mount_enter_mounted(m, false);
@@ -1318,10 +1318,10 @@ static void mount_timer_event(Unit *u, uint64_t elapsed, Watch *w) {
 
         case MOUNT_REMOUNTING_SIGTERM:
                 if (m->exec_context.send_sigkill) {
 
         case MOUNT_REMOUNTING_SIGTERM:
                 if (m->exec_context.send_sigkill) {
-                        log_warning("%s remounting timed out. Killing.", u->meta.id);
+                        log_warning("%s remounting timed out. Killing.", u->id);
                         mount_enter_signal(m, MOUNT_REMOUNTING_SIGKILL, false);
                 } else {
                         mount_enter_signal(m, MOUNT_REMOUNTING_SIGKILL, false);
                 } else {
-                        log_warning("%s remounting timed out. Skipping SIGKILL. Ignoring.", u->meta.id);
+                        log_warning("%s remounting timed out. Skipping SIGKILL. Ignoring.", u->id);
 
                         if (m->from_proc_self_mountinfo)
                                 mount_enter_mounted(m, false);
 
                         if (m->from_proc_self_mountinfo)
                                 mount_enter_mounted(m, false);
@@ -1332,10 +1332,10 @@ static void mount_timer_event(Unit *u, uint64_t elapsed, Watch *w) {
 
         case MOUNT_UNMOUNTING_SIGTERM:
                 if (m->exec_context.send_sigkill) {
 
         case MOUNT_UNMOUNTING_SIGTERM:
                 if (m->exec_context.send_sigkill) {
-                        log_warning("%s unmounting timed out. Killing.", u->meta.id);
+                        log_warning("%s unmounting timed out. Killing.", u->id);
                         mount_enter_signal(m, MOUNT_UNMOUNTING_SIGKILL, false);
                 } else {
                         mount_enter_signal(m, MOUNT_UNMOUNTING_SIGKILL, false);
                 } else {
-                        log_warning("%s unmounting timed out. Skipping SIGKILL. Ignoring.", u->meta.id);
+                        log_warning("%s unmounting timed out. Skipping SIGKILL. Ignoring.", u->id);
 
                         if (m->from_proc_self_mountinfo)
                                 mount_enter_mounted(m, false);
 
                         if (m->from_proc_self_mountinfo)
                                 mount_enter_mounted(m, false);
@@ -1347,7 +1347,7 @@ static void mount_timer_event(Unit *u, uint64_t elapsed, Watch *w) {
         case MOUNT_MOUNTING_SIGKILL:
         case MOUNT_REMOUNTING_SIGKILL:
         case MOUNT_UNMOUNTING_SIGKILL:
         case MOUNT_MOUNTING_SIGKILL:
         case MOUNT_REMOUNTING_SIGKILL:
         case MOUNT_UNMOUNTING_SIGKILL:
-                log_warning("%s mount process still around after SIGKILL. Ignoring.", u->meta.id);
+                log_warning("%s mount process still around after SIGKILL. Ignoring.", u->id);
 
                 if (m->from_proc_self_mountinfo)
                         mount_enter_mounted(m, false);
 
                 if (m->from_proc_self_mountinfo)
                         mount_enter_mounted(m, false);
@@ -1679,7 +1679,7 @@ fail:
 }
 
 void mount_fd_event(Manager *m, int events) {
 }
 
 void mount_fd_event(Manager *m, int events) {
-        Meta *meta;
+        Unit *meta;
         int r;
 
         assert(m);
         int r;
 
         assert(m);
index 7c5d9d1..730c4c2 100644 (file)
@@ -60,7 +60,7 @@ typedef struct MountParameters {
 } MountParameters;
 
 struct Mount {
 } MountParameters;
 
 struct Mount {
-        Meta meta;
+        Unit meta;
 
         char *where;
 
 
         char *where;
 
index ae5052a..bfb5cdf 100644 (file)
@@ -236,7 +236,7 @@ static void path_init(Unit *u) {
         Path *p = PATH(u);
 
         assert(u);
         Path *p = PATH(u);
 
         assert(u);
-        assert(u->meta.load_state == UNIT_STUB);
+        assert(u->load_state == UNIT_STUB);
 
         p->directory_mode = 0755;
 }
 
         p->directory_mode = 0755;
 }
@@ -281,7 +281,7 @@ int path_add_one_mount_link(Path *p, Mount *m) {
 }
 
 static int path_add_mount_links(Path *p) {
 }
 
 static int path_add_mount_links(Path *p) {
-        Meta *other;
+        Unit *other;
         int r;
 
         assert(p);
         int r;
 
         assert(p);
@@ -328,12 +328,12 @@ static int path_load(Unit *u) {
         int r;
 
         assert(u);
         int r;
 
         assert(u);
-        assert(u->meta.load_state == UNIT_STUB);
+        assert(u->load_state == UNIT_STUB);
 
         if ((r = unit_load_fragment_and_dropin(u)) < 0)
                 return r;
 
 
         if ((r = unit_load_fragment_and_dropin(u)) < 0)
                 return r;
 
-        if (u->meta.load_state == UNIT_LOADED) {
+        if (u->load_state == UNIT_LOADED) {
 
                 if (!UNIT_DEREF(p->unit)) {
                         Unit *x;
 
                 if (!UNIT_DEREF(p->unit)) {
                         Unit *x;
@@ -373,7 +373,7 @@ static void path_dump(Unit *u, FILE *f, const char *prefix) {
                 "%sMakeDirectory: %s\n"
                 "%sDirectoryMode: %04o\n",
                 prefix, path_state_to_string(p->state),
                 "%sMakeDirectory: %s\n"
                 "%sDirectoryMode: %04o\n",
                 prefix, path_state_to_string(p->state),
-                prefix, UNIT_DEREF(p->unit)->meta.id,
+                prefix, UNIT_DEREF(p->unit)->id,
                 prefix, yes_no(p->make_directory),
                 prefix, p->directory_mode);
 
                 prefix, yes_no(p->make_directory),
                 prefix, p->directory_mode);
 
@@ -547,7 +547,7 @@ static int path_start(Unit *u) {
         assert(p);
         assert(p->state == PATH_DEAD || p->state == PATH_FAILED);
 
         assert(p);
         assert(p->state == PATH_DEAD || p->state == PATH_FAILED);
 
-        if (UNIT_DEREF(p->unit)->meta.load_state != UNIT_LOADED)
+        if (UNIT_DEREF(p->unit)->load_state != UNIT_LOADED)
                 return -ENOENT;
 
         path_mkdir(p);
                 return -ENOENT;
 
         path_mkdir(p);
@@ -625,7 +625,7 @@ static void path_fd_event(Unit *u, int fd, uint32_t events, Watch *w) {
             p->state != PATH_RUNNING)
                 return;
 
             p->state != PATH_RUNNING)
                 return;
 
-        /* log_debug("inotify wakeup on %s.", u->meta.id); */
+        /* log_debug("inotify wakeup on %s.", u->id); */
 
         LIST_FOREACH(spec, s, p->specs)
                 if (path_spec_owns_inotify_fd(s, fd))
 
         LIST_FOREACH(spec, s, p->specs)
                 if (path_spec_owns_inotify_fd(s, fd))
@@ -660,16 +660,16 @@ void path_unit_notify(Unit *u, UnitActiveState new_state) {
         Iterator i;
         Unit *k;
 
         Iterator i;
         Unit *k;
 
-        if (u->meta.type == UNIT_PATH)
+        if (u->type == UNIT_PATH)
                 return;
 
                 return;
 
-        SET_FOREACH(k, u->meta.dependencies[UNIT_TRIGGERED_BY], i) {
+        SET_FOREACH(k, u->dependencies[UNIT_TRIGGERED_BY], i) {
                 Path *p;
 
                 Path *p;
 
-                if (k->meta.type != UNIT_PATH)
+                if (k->type != UNIT_PATH)
                         continue;
 
                         continue;
 
-                if (k->meta.load_state != UNIT_LOADED)
+                if (k->load_state != UNIT_LOADED)
                         continue;
 
                 p = PATH(k);
                         continue;
 
                 p = PATH(k);
index 8b3c0bc..04d43c8 100644 (file)
@@ -70,7 +70,7 @@ static inline bool path_spec_owns_inotify_fd(PathSpec *s, int fd) {
 }
 
 struct Path {
 }
 
 struct Path {
-        Meta meta;
+        Unit meta;
 
         LIST_HEAD(PathSpec, specs);
 
 
         LIST_HEAD(PathSpec, specs);
 
index 6ce6b19..5543077 100644 (file)
@@ -108,7 +108,7 @@ static void service_init(Unit *u) {
         Service *s = SERVICE(u);
 
         assert(u);
         Service *s = SERVICE(u);
 
         assert(u);
-        assert(u->meta.load_state == UNIT_STUB);
+        assert(u->load_state == UNIT_STUB);
 
         s->timeout_usec = DEFAULT_TIMEOUT_USEC;
         s->restart_usec = DEFAULT_RESTART_USEC;
 
         s->timeout_usec = DEFAULT_TIMEOUT_USEC;
         s->restart_usec = DEFAULT_RESTART_USEC;
@@ -224,7 +224,7 @@ static void service_done(Unit *u) {
         service_unwatch_control_pid(s);
 
         if (s->bus_name)  {
         service_unwatch_control_pid(s);
 
         if (s->bus_name)  {
-                unit_unwatch_bus_name(UNIT(u), s->bus_name);
+                unit_unwatch_bus_name(u, s->bus_name);
                 free(s->bus_name);
                 s->bus_name = NULL;
         }
                 free(s->bus_name);
                 s->bus_name = NULL;
         }
@@ -360,7 +360,7 @@ finish:
 }
 
 static int sysv_fix_order(Service *s) {
 }
 
 static int sysv_fix_order(Service *s) {
-        Meta *other;
+        Unit *other;
         int r;
 
         assert(s);
         int r;
 
         assert(s);
@@ -496,7 +496,7 @@ static int service_load_sysv_path(Service *s, const char *path) {
         s->sysv_mtime = timespec_load(&st.st_mtim);
 
         if (null_or_empty(&st)) {
         s->sysv_mtime = timespec_load(&st.st_mtim);
 
         if (null_or_empty(&st)) {
-                u->meta.load_state = UNIT_MASKED;
+                u->load_state = UNIT_MASKED;
                 r = 0;
                 goto finish;
         }
                 r = 0;
                 goto finish;
         }
@@ -865,7 +865,7 @@ static int service_load_sysv_path(Service *s, const char *path) {
                         goto finish;
                 }
 
                         goto finish;
                 }
 
-                u->meta.description = d;
+                u->description = d;
         }
 
         /* The priority that has been set in /etc/rcN.d/ hierarchies
         }
 
         /* The priority that has been set in /etc/rcN.d/ hierarchies
@@ -874,7 +874,7 @@ static int service_load_sysv_path(Service *s, const char *path) {
         if (s->sysv_start_priority_from_rcnd >= 0)
                 s->sysv_start_priority = s->sysv_start_priority_from_rcnd;
 
         if (s->sysv_start_priority_from_rcnd >= 0)
                 s->sysv_start_priority = s->sysv_start_priority_from_rcnd;
 
-        u->meta.load_state = UNIT_LOADED;
+        u->load_state = UNIT_LOADED;
         r = 0;
 
 finish:
         r = 0;
 
 finish:
@@ -1008,7 +1008,7 @@ static int service_load_sysv(Service *s) {
 #endif
 
 static int fsck_fix_order(Service *s) {
 #endif
 
 static int fsck_fix_order(Service *s) {
-        Meta *other;
+        Unit *other;
         int r;
 
         assert(s);
         int r;
 
         assert(s);
@@ -1138,13 +1138,13 @@ static int service_load(Unit *u) {
 
 #ifdef HAVE_SYSV_COMPAT
         /* Load a classic init script as a fallback, if we couldn't find anything */
 
 #ifdef HAVE_SYSV_COMPAT
         /* Load a classic init script as a fallback, if we couldn't find anything */
-        if (u->meta.load_state == UNIT_STUB)
+        if (u->load_state == UNIT_STUB)
                 if ((r = service_load_sysv(s)) < 0)
                         return r;
 #endif
 
         /* Still nothing found? Then let's give up */
                 if ((r = service_load_sysv(s)) < 0)
                         return r;
 #endif
 
         /* Still nothing found? Then let's give up */
-        if (u->meta.load_state == UNIT_STUB)
+        if (u->load_state == UNIT_STUB)
                 return -ENOENT;
 
         /* We were able to load something, then let's add in the
                 return -ENOENT;
 
         /* We were able to load something, then let's add in the
@@ -1153,7 +1153,7 @@ static int service_load(Unit *u) {
                 return r;
 
         /* This is a new unit? Then let's add in some extras */
                 return r;
 
         /* This is a new unit? Then let's add in some extras */
-        if (u->meta.load_state == UNIT_LOADED) {
+        if (u->load_state == UNIT_LOADED) {
                 service_fix_output(s);
 
                 if ((r = unit_add_exec_dependencies(u, &s->exec_context)) < 0)
                 service_fix_output(s);
 
                 if ((r = unit_add_exec_dependencies(u, &s->exec_context)) < 0)
@@ -1383,7 +1383,7 @@ static void service_notify_sockets_dead(Service *s) {
                 return;
 
         SET_FOREACH(u, s->meta.dependencies[UNIT_TRIGGERED_BY], i)
                 return;
 
         SET_FOREACH(u, s->meta.dependencies[UNIT_TRIGGERED_BY], i)
-                if (u->meta.type == UNIT_SOCKET)
+                if (u->type == UNIT_SOCKET)
                         socket_notify_service_dead(SOCKET(u));
 
         return;
                         socket_notify_service_dead(SOCKET(u));
 
         return;
@@ -1572,7 +1572,7 @@ static int service_collect_fds(Service *s, int **fds, unsigned *n_fds) {
                 unsigned cn_fds;
                 Socket *sock;
 
                 unsigned cn_fds;
                 Socket *sock;
 
-                if (u->meta.type != UNIT_SOCKET)
+                if (u->type != UNIT_SOCKET)
                         continue;
 
                 sock = SOCKET(u);
                         continue;
 
                 sock = SOCKET(u);
@@ -2291,7 +2291,7 @@ static int service_start(Unit *u) {
 
         /* Make sure we don't enter a busy loop of some kind. */
         if (!ratelimit_test(&s->ratelimit)) {
 
         /* Make sure we don't enter a busy loop of some kind. */
         if (!ratelimit_test(&s->ratelimit)) {
-                log_warning("%s start request repeated too quickly, refusing to start.", u->meta.id);
+                log_warning("%s start request repeated too quickly, refusing to start.", u->id);
                 return -ECANCELED;
         }
 
                 return -ECANCELED;
         }
 
@@ -2628,7 +2628,7 @@ static void service_fd_event(Unit *u, int fd, uint32_t events, Watch *w) {
         assert(s->pid_file_pathspec);
         assert(path_spec_owns_inotify_fd(s->pid_file_pathspec, fd));
 
         assert(s->pid_file_pathspec);
         assert(path_spec_owns_inotify_fd(s->pid_file_pathspec, fd));
 
-        log_debug("inotify event for %s", u->meta.id);
+        log_debug("inotify event for %s", u->id);
 
         if (path_spec_fd_event(s->pid_file_pathspec, events) < 0)
                 goto fail;
 
         if (path_spec_fd_event(s->pid_file_pathspec, events) < 0)
                 goto fail;
@@ -2679,7 +2679,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                 }
 
                 log_full(success ? LOG_DEBUG : LOG_NOTICE,
                 }
 
                 log_full(success ? LOG_DEBUG : LOG_NOTICE,
-                         "%s: main process exited, code=%s, status=%i", u->meta.id, sigchld_code_to_string(code), status);
+                         "%s: main process exited, code=%s, status=%i", u->id, sigchld_code_to_string(code), status);
                 s->failure = s->failure || !success;
 
                 if (s->main_command &&
                 s->failure = s->failure || !success;
 
                 if (s->main_command &&
@@ -2689,7 +2689,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                         /* There is another command to *
                          * execute, so let's do that. */
 
                         /* There is another command to *
                          * execute, so let's do that. */
 
-                        log_debug("%s running next main command for state %s", u->meta.id, service_state_to_string(s->state));
+                        log_debug("%s running next main command for state %s", u->id, service_state_to_string(s->state));
                         service_run_next_main(s, success);
 
                 } else {
                         service_run_next_main(s, success);
 
                 } else {
@@ -2751,7 +2751,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                 }
 
                 log_full(success ? LOG_DEBUG : LOG_NOTICE,
                 }
 
                 log_full(success ? LOG_DEBUG : LOG_NOTICE,
-                         "%s: control process exited, code=%s status=%i", u->meta.id, sigchld_code_to_string(code), status);
+                         "%s: control process exited, code=%s status=%i", u->id, sigchld_code_to_string(code), status);
                 s->failure = s->failure || !success;
 
                 if (s->control_command &&
                 s->failure = s->failure || !success;
 
                 if (s->control_command &&
@@ -2761,7 +2761,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                         /* There is another command to *
                          * execute, so let's do that. */
 
                         /* There is another command to *
                          * execute, so let's do that. */
 
-                        log_debug("%s running next control command for state %s", u->meta.id, service_state_to_string(s->state));
+                        log_debug("%s running next control command for state %s", u->id, service_state_to_string(s->state));
                         service_run_next_control(s, success);
 
                 } else {
                         service_run_next_control(s, success);
 
                 } else {
@@ -2771,7 +2771,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                         s->control_command = NULL;
                         s->control_command_id = _SERVICE_EXEC_COMMAND_INVALID;
 
                         s->control_command = NULL;
                         s->control_command_id = _SERVICE_EXEC_COMMAND_INVALID;
 
-                        log_debug("%s got final SIGCHLD for state %s", u->meta.id, service_state_to_string(s->state));
+                        log_debug("%s got final SIGCHLD for state %s", u->id, service_state_to_string(s->state));
 
                         switch (s->state) {
 
 
                         switch (s->state) {
 
@@ -2880,32 +2880,32 @@ static void service_timer_event(Unit *u, uint64_t elapsed, Watch* w) {
 
         case SERVICE_START_PRE:
         case SERVICE_START:
 
         case SERVICE_START_PRE:
         case SERVICE_START:
-                log_warning("%s operation timed out. Terminating.", u->meta.id);
+                log_warning("%s operation timed out. Terminating.", u->id);
                 service_enter_signal(s, SERVICE_FINAL_SIGTERM, false);
                 break;
 
         case SERVICE_START_POST:
                 service_enter_signal(s, SERVICE_FINAL_SIGTERM, false);
                 break;
 
         case SERVICE_START_POST:
-                log_warning("%s operation timed out. Stopping.", u->meta.id);
+                log_warning("%s operation timed out. Stopping.", u->id);
                 service_enter_stop(s, false);
                 break;
 
         case SERVICE_RELOAD:
                 service_enter_stop(s, false);
                 break;
 
         case SERVICE_RELOAD:
-                log_warning("%s operation timed out. Stopping.", u->meta.id);
+                log_warning("%s operation timed out. Stopping.", u->id);
                 s->reload_failure = true;
                 service_enter_running(s, true);
                 break;
 
         case SERVICE_STOP:
                 s->reload_failure = true;
                 service_enter_running(s, true);
                 break;
 
         case SERVICE_STOP:
-                log_warning("%s stopping timed out. Terminating.", u->meta.id);
+                log_warning("%s stopping timed out. Terminating.", u->id);
                 service_enter_signal(s, SERVICE_STOP_SIGTERM, false);
                 break;
 
         case SERVICE_STOP_SIGTERM:
                 if (s->exec_context.send_sigkill) {
                 service_enter_signal(s, SERVICE_STOP_SIGTERM, false);
                 break;
 
         case SERVICE_STOP_SIGTERM:
                 if (s->exec_context.send_sigkill) {
-                        log_warning("%s stopping timed out. Killing.", u->meta.id);
+                        log_warning("%s stopping timed out. Killing.", u->id);
                         service_enter_signal(s, SERVICE_STOP_SIGKILL, false);
                 } else {
                         service_enter_signal(s, SERVICE_STOP_SIGKILL, false);
                 } else {
-                        log_warning("%s stopping timed out. Skipping SIGKILL.", u->meta.id);
+                        log_warning("%s stopping timed out. Skipping SIGKILL.", u->id);
                         service_enter_stop_post(s, false);
                 }
 
                         service_enter_stop_post(s, false);
                 }
 
@@ -2916,33 +2916,33 @@ static void service_timer_event(Unit *u, uint64_t elapsed, Watch* w) {
                  * Must be something we cannot kill, so let's just be
                  * weirded out and continue */
 
                  * Must be something we cannot kill, so let's just be
                  * weirded out and continue */
 
-                log_warning("%s still around after SIGKILL. Ignoring.", u->meta.id);
+                log_warning("%s still around after SIGKILL. Ignoring.", u->id);
                 service_enter_stop_post(s, false);
                 break;
 
         case SERVICE_STOP_POST:
                 service_enter_stop_post(s, false);
                 break;
 
         case SERVICE_STOP_POST:
-                log_warning("%s stopping timed out (2). Terminating.", u->meta.id);
+                log_warning("%s stopping timed out (2). Terminating.", u->id);
                 service_enter_signal(s, SERVICE_FINAL_SIGTERM, false);
                 break;
 
         case SERVICE_FINAL_SIGTERM:
                 if (s->exec_context.send_sigkill) {
                 service_enter_signal(s, SERVICE_FINAL_SIGTERM, false);
                 break;
 
         case SERVICE_FINAL_SIGTERM:
                 if (s->exec_context.send_sigkill) {
-                        log_warning("%s stopping timed out (2). Killing.", u->meta.id);
+                        log_warning("%s stopping timed out (2). Killing.", u->id);
                         service_enter_signal(s, SERVICE_FINAL_SIGKILL, false);
                 } else {
                         service_enter_signal(s, SERVICE_FINAL_SIGKILL, false);
                 } else {
-                        log_warning("%s stopping timed out (2). Skipping SIGKILL. Entering failed mode.", u->meta.id);
+                        log_warning("%s stopping timed out (2). Skipping SIGKILL. Entering failed mode.", u->id);
                         service_enter_dead(s, false, true);
                 }
 
                 break;
 
         case SERVICE_FINAL_SIGKILL:
                         service_enter_dead(s, false, true);
                 }
 
                 break;
 
         case SERVICE_FINAL_SIGKILL:
-                log_warning("%s still around after SIGKILL (2). Entering failed mode.", u->meta.id);
+                log_warning("%s still around after SIGKILL (2). Entering failed mode.", u->id);
                 service_enter_dead(s, false, true);
                 break;
 
         case SERVICE_AUTO_RESTART:
                 service_enter_dead(s, false, true);
                 break;
 
         case SERVICE_AUTO_RESTART:
-                log_info("%s holdoff time over, scheduling restart.", u->meta.id);
+                log_info("%s holdoff time over, scheduling restart.", u->id);
                 service_enter_restart(s);
                 break;
 
                 service_enter_restart(s);
                 break;
 
@@ -2956,7 +2956,7 @@ static void service_cgroup_notify_event(Unit *u) {
 
         assert(u);
 
 
         assert(u);
 
-        log_debug("%s: cgroup is empty", u->meta.id);
+        log_debug("%s: cgroup is empty", u->id);
 
         switch (s->state) {
 
 
         switch (s->state) {
 
@@ -3012,17 +3012,17 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) {
 
         if (s->notify_access == NOTIFY_NONE) {
                 log_warning("%s: Got notification message from PID %lu, but reception is disabled.",
 
         if (s->notify_access == NOTIFY_NONE) {
                 log_warning("%s: Got notification message from PID %lu, but reception is disabled.",
-                            u->meta.id, (unsigned long) pid);
+                            u->id, (unsigned long) pid);
                 return;
         }
 
         if (s->notify_access == NOTIFY_MAIN && pid != s->main_pid) {
                 log_warning("%s: Got notification message from PID %lu, but reception only permitted for PID %lu",
                 return;
         }
 
         if (s->notify_access == NOTIFY_MAIN && pid != s->main_pid) {
                 log_warning("%s: Got notification message from PID %lu, but reception only permitted for PID %lu",
-                            u->meta.id, (unsigned long) pid, (unsigned long) s->main_pid);
+                            u->id, (unsigned long) pid, (unsigned long) s->main_pid);
                 return;
         }
 
                 return;
         }
 
-        log_debug("%s: Got message", u->meta.id);
+        log_debug("%s: Got message", u->id);
 
         /* Interpret MAINPID= */
         if ((e = strv_find_prefix(tags, "MAINPID=")) &&
 
         /* Interpret MAINPID= */
         if ((e = strv_find_prefix(tags, "MAINPID=")) &&
@@ -3034,7 +3034,7 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) {
                 if (parse_pid(e + 8, &pid) < 0)
                         log_warning("Failed to parse notification message %s", e);
                 else {
                 if (parse_pid(e + 8, &pid) < 0)
                         log_warning("Failed to parse notification message %s", e);
                 else {
-                        log_debug("%s: got %s", u->meta.id, e);
+                        log_debug("%s: got %s", u->id, e);
                         service_set_main_pid(s, pid);
                 }
         }
                         service_set_main_pid(s, pid);
                 }
         }
@@ -3043,7 +3043,7 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) {
         if (s->type == SERVICE_NOTIFY &&
             s->state == SERVICE_START &&
             strv_find(tags, "READY=1")) {
         if (s->type == SERVICE_NOTIFY &&
             s->state == SERVICE_START &&
             strv_find(tags, "READY=1")) {
-                log_debug("%s: got READY=1", u->meta.id);
+                log_debug("%s: got READY=1", u->id);
 
                 service_enter_start_post(s);
         }
 
                 service_enter_start_post(s);
         }
@@ -3058,7 +3058,7 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) {
                                 return;
                         }
 
                                 return;
                         }
 
-                        log_debug("%s: got %s", u->meta.id, e);
+                        log_debug("%s: got %s", u->id, e);
 
                         free(s->status_text);
                         s->status_text = t;
 
                         free(s->status_text);
                         s->status_text = t;
@@ -3109,7 +3109,7 @@ static void sysv_facility_in_insserv_conf(Manager *mgr) {
                         Unit *u;
                         if (sysv_translate_facility(parsed[0], NULL, &facility) < 0)
                                 continue;
                         Unit *u;
                         if (sysv_translate_facility(parsed[0], NULL, &facility) < 0)
                                 continue;
-                        if ((u = manager_get_unit(mgr, facility)) && (u->meta.type == UNIT_TARGET)) {
+                        if ((u = manager_get_unit(mgr, facility)) && (u->type == UNIT_TARGET)) {
                                 UnitDependency e;
                                 char *dep = NULL, *name, **j;
 
                                 UnitDependency e;
                                 char *dep = NULL, *name, **j;
 
@@ -3262,7 +3262,7 @@ static int service_enumerate(Manager *m) {
                 SET_FOREACH(service, runlevel_services[i], j) {
                         service = unit_follow_merge(service);
 
                 SET_FOREACH(service, runlevel_services[i], j) {
                         service = unit_follow_merge(service);
 
-                        if (service->meta.fragment_path)
+                        if (service->fragment_path)
                                 continue;
 
                         if ((r = unit_add_two_dependencies_by_name_inverse(service, UNIT_AFTER, UNIT_WANTS, rcnd_table[i].target, NULL, true)) < 0)
                                 continue;
 
                         if ((r = unit_add_two_dependencies_by_name_inverse(service, UNIT_AFTER, UNIT_WANTS, rcnd_table[i].target, NULL, true)) < 0)
@@ -3279,7 +3279,7 @@ static int service_enumerate(Manager *m) {
         SET_FOREACH(service, shutdown_services, j) {
                 service = unit_follow_merge(service);
 
         SET_FOREACH(service, shutdown_services, j) {
                 service = unit_follow_merge(service);
 
-                if (service->meta.fragment_path)
+                if (service->fragment_path)
                         continue;
 
                 if ((r = unit_add_two_dependencies_by_name(service, UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, NULL, true)) < 0)
                         continue;
 
                 if ((r = unit_add_two_dependencies_by_name(service, UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, NULL, true)) < 0)
@@ -3323,11 +3323,11 @@ static void service_bus_name_owner_change(
         assert(old_owner || new_owner);
 
         if (old_owner && new_owner)
         assert(old_owner || new_owner);
 
         if (old_owner && new_owner)
-                log_debug("%s's D-Bus name %s changed owner from %s to %s", u->meta.id, name, old_owner, new_owner);
+                log_debug("%s's D-Bus name %s changed owner from %s to %s", u->id, name, old_owner, new_owner);
         else if (old_owner)
         else if (old_owner)
-                log_debug("%s's D-Bus name %s no longer registered by %s", u->meta.id, name, old_owner);
+                log_debug("%s's D-Bus name %s no longer registered by %s", u->id, name, old_owner);
         else
         else
-                log_debug("%s's D-Bus name %s now registered by %s", u->meta.id, name, new_owner);
+                log_debug("%s's D-Bus name %s now registered by %s", u->id, name, new_owner);
 
         s->bus_name_good = !!new_owner;
 
 
         s->bus_name_good = !!new_owner;
 
@@ -3350,7 +3350,7 @@ static void service_bus_name_owner_change(
                 /* Try to acquire PID from bus service */
                 log_debug("Trying to acquire PID from D-Bus name...");
 
                 /* Try to acquire PID from bus service */
                 log_debug("Trying to acquire PID from D-Bus name...");
 
-                bus_query_pid(u->meta.manager, name);
+                bus_query_pid(u->manager, name);
         }
 }
 
         }
 }
 
@@ -3364,7 +3364,7 @@ static void service_bus_query_pid_done(
         assert(s);
         assert(name);
 
         assert(s);
         assert(name);
 
-        log_debug("%s's D-Bus name %s is now owned by process %u", u->meta.id, name, (unsigned) pid);
+        log_debug("%s's D-Bus name %s is now owned by process %u", u->id, name, (unsigned) pid);
 
         if (s->main_pid <= 0 &&
             (s->state == SERVICE_START ||
 
         if (s->main_pid <= 0 &&
             (s->state == SERVICE_START ||
index 8f67ad5..0b4f8be 100644 (file)
@@ -89,7 +89,7 @@ typedef enum NotifyAccess {
 } NotifyAccess;
 
 struct Service {
 } NotifyAccess;
 
 struct Service {
-        Meta meta;
+        Unit meta;
 
         ServiceType type;
         ServiceRestart restart;
 
         ServiceType type;
         ServiceRestart restart;
index 161629d..bc1388c 100644 (file)
@@ -62,14 +62,14 @@ static int snapshot_load(Unit *u) {
         Snapshot *s = SNAPSHOT(u);
 
         assert(u);
         Snapshot *s = SNAPSHOT(u);
 
         assert(u);
-        assert(u->meta.load_state == UNIT_STUB);
+        assert(u->load_state == UNIT_STUB);
 
         /* Make sure that only snapshots created via snapshot_create()
          * can be loaded */
         if (!s->by_snapshot_create && s->meta.manager->n_reloading <= 0)
                 return -ENOENT;
 
 
         /* Make sure that only snapshots created via snapshot_create()
          * can be loaded */
         if (!s->by_snapshot_create && s->meta.manager->n_reloading <= 0)
                 return -ENOENT;
 
-        u->meta.load_state = UNIT_LOADED;
+        u->load_state = UNIT_LOADED;
         return 0;
 }
 
         return 0;
 }
 
@@ -133,8 +133,8 @@ static int snapshot_serialize(Unit *u, FILE *f, FDSet *fds) {
 
         unit_serialize_item(u, f, "state", snapshot_state_to_string(s->state));
         unit_serialize_item(u, f, "cleanup", yes_no(s->cleanup));
 
         unit_serialize_item(u, f, "state", snapshot_state_to_string(s->state));
         unit_serialize_item(u, f, "cleanup", yes_no(s->cleanup));
-        SET_FOREACH(other, u->meta.dependencies[UNIT_WANTS], i)
-                unit_serialize_item(u, f, "wants", other->meta.id);
+        SET_FOREACH(other, u->dependencies[UNIT_WANTS], i)
+                unit_serialize_item(u, f, "wants", other->id);
 
         return 0;
 }
 
         return 0;
 }
@@ -234,14 +234,14 @@ int snapshot_create(Manager *m, const char *name, bool cleanup, DBusError *e, Sn
 
         SNAPSHOT(u)->by_snapshot_create = true;
         manager_dispatch_load_queue(m);
 
         SNAPSHOT(u)->by_snapshot_create = true;
         manager_dispatch_load_queue(m);
-        assert(u->meta.load_state == UNIT_LOADED);
+        assert(u->load_state == UNIT_LOADED);
 
         HASHMAP_FOREACH_KEY(other, k, m->units, i) {
 
 
         HASHMAP_FOREACH_KEY(other, k, m->units, i) {
 
-                if (other->meta.ignore_on_snapshot)
+                if (other->ignore_on_snapshot)
                         continue;
 
                         continue;
 
-                if (k != other->meta.id)
+                if (k != other->id)
                         continue;
 
                 if (UNIT_VTABLE(other)->check_snapshot)
                         continue;
 
                 if (UNIT_VTABLE(other)->check_snapshot)
index 9a30520..bf92e99 100644 (file)
@@ -34,7 +34,7 @@ typedef enum SnapshotState {
 } SnapshotState;
 
 struct Snapshot {
 } SnapshotState;
 
 struct Snapshot {
-        Meta meta;
+        Unit meta;
 
         SnapshotState state, deserialized_state;
 
 
         SnapshotState state, deserialized_state;
 
index 1a245aa..a9ab82c 100644 (file)
@@ -64,7 +64,7 @@ static void socket_init(Unit *u) {
         Socket *s = SOCKET(u);
 
         assert(u);
         Socket *s = SOCKET(u);
 
         assert(u);
-        assert(u->meta.load_state == UNIT_STUB);
+        assert(u->load_state == UNIT_STUB);
 
         s->backlog = SOMAXCONN;
         s->timeout_usec = DEFAULT_TIMEOUT_USEC;
 
         s->backlog = SOMAXCONN;
         s->timeout_usec = DEFAULT_TIMEOUT_USEC;
@@ -79,8 +79,8 @@ static void socket_init(Unit *u) {
         s->mark = -1;
 
         exec_context_init(&s->exec_context);
         s->mark = -1;
 
         exec_context_init(&s->exec_context);
-        s->exec_context.std_output = u->meta.manager->default_std_output;
-        s->exec_context.std_error = u->meta.manager->default_std_error;
+        s->exec_context.std_output = u->manager->default_std_output;
+        s->exec_context.std_error = u->manager->default_std_error;
 
         s->control_command_id = _SOCKET_EXEC_COMMAND_INVALID;
 }
 
         s->control_command_id = _SOCKET_EXEC_COMMAND_INVALID;
 }
@@ -169,7 +169,7 @@ static int socket_instantiate_service(Socket *s) {
         }
 #endif
 
         }
 #endif
 
-        u->meta.no_gc = true;
+        u->no_gc = true;
         unit_ref_set(&s->service, u);
 
         return unit_add_two_dependencies(UNIT(s), UNIT_BEFORE, UNIT_TRIGGERS, u, false);
         unit_ref_set(&s->service, u);
 
         return unit_add_two_dependencies(UNIT(s), UNIT_BEFORE, UNIT_TRIGGERS, u, false);
@@ -268,7 +268,7 @@ int socket_add_one_mount_link(Socket *s, Mount *m) {
 }
 
 static int socket_add_mount_links(Socket *s) {
 }
 
 static int socket_add_mount_links(Socket *s) {
-        Meta *other;
+        Unit *other;
         int r;
 
         assert(s);
         int r;
 
         assert(s);
@@ -329,13 +329,13 @@ static int socket_load(Unit *u) {
         int r;
 
         assert(u);
         int r;
 
         assert(u);
-        assert(u->meta.load_state == UNIT_STUB);
+        assert(u->load_state == UNIT_STUB);
 
         if ((r = unit_load_fragment_and_dropin(u)) < 0)
                 return r;
 
         /* This is a new unit? Then let's add in some extras */
 
         if ((r = unit_load_fragment_and_dropin(u)) < 0)
                 return r;
 
         /* This is a new unit? Then let's add in some extras */
-        if (u->meta.load_state == UNIT_LOADED) {
+        if (u->load_state == UNIT_LOADED) {
 
                 if (have_non_accept_socket(s)) {
 
 
                 if (have_non_accept_socket(s)) {
 
@@ -1787,14 +1787,14 @@ static void socket_fd_event(Unit *u, int fd, uint32_t events, Watch *w) {
         if (s->state != SOCKET_LISTENING)
                 return;
 
         if (s->state != SOCKET_LISTENING)
                 return;
 
-        log_debug("Incoming traffic on %s", u->meta.id);
+        log_debug("Incoming traffic on %s", u->id);
 
         if (events != EPOLLIN) {
 
                 if (events & EPOLLHUP)
 
         if (events != EPOLLIN) {
 
                 if (events & EPOLLHUP)
-                        log_error("%s: Got POLLHUP on a listening socket. The service probably invoked shutdown() on it, and should better not do that.", u->meta.id);
+                        log_error("%s: Got POLLHUP on a listening socket. The service probably invoked shutdown() on it, and should better not do that.", u->id);
                 else
                 else
-                        log_error("%s: Got unexpected poll event (0x%x) on socket.", u->meta.id, events);
+                        log_error("%s: Got unexpected poll event (0x%x) on socket.", u->id, events);
 
                 goto fail;
         }
 
                 goto fail;
         }
@@ -1846,11 +1846,11 @@ static void socket_sigchld_event(Unit *u, pid_t pid, int code, int status) {
         }
 
         log_full(success ? LOG_DEBUG : LOG_NOTICE,
         }
 
         log_full(success ? LOG_DEBUG : LOG_NOTICE,
-                 "%s control process exited, code=%s status=%i", u->meta.id, sigchld_code_to_string(code), status);
+                 "%s control process exited, code=%s status=%i", u->id, sigchld_code_to_string(code), status);
         s->failure = s->failure || !success;
 
         if (s->control_command && s->control_command->command_next && success) {
         s->failure = s->failure || !success;
 
         if (s->control_command && s->control_command->command_next && success) {
-                log_debug("%s running next command for state %s", u->meta.id, socket_state_to_string(s->state));
+                log_debug("%s running next command for state %s", u->id, socket_state_to_string(s->state));
                 socket_run_next(s, success);
         } else {
                 s->control_command = NULL;
                 socket_run_next(s, success);
         } else {
                 s->control_command = NULL;
@@ -1859,7 +1859,7 @@ static void socket_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                 /* No further commands for this step, so let's figure
                  * out what to do next */
 
                 /* No further commands for this step, so let's figure
                  * out what to do next */
 
-                log_debug("%s got final SIGCHLD for state %s", u->meta.id, socket_state_to_string(s->state));
+                log_debug("%s got final SIGCHLD for state %s", u->id, socket_state_to_string(s->state));
 
                 switch (s->state) {
 
 
                 switch (s->state) {
 
@@ -1908,52 +1908,52 @@ static void socket_timer_event(Unit *u, uint64_t elapsed, Watch *w) {
         switch (s->state) {
 
         case SOCKET_START_PRE:
         switch (s->state) {
 
         case SOCKET_START_PRE:
-                log_warning("%s starting timed out. Terminating.", u->meta.id);
+                log_warning("%s starting timed out. Terminating.", u->id);
                 socket_enter_signal(s, SOCKET_FINAL_SIGTERM, false);
                 break;
 
         case SOCKET_START_POST:
                 socket_enter_signal(s, SOCKET_FINAL_SIGTERM, false);
                 break;
 
         case SOCKET_START_POST:
-                log_warning("%s starting timed out. Stopping.", u->meta.id);
+                log_warning("%s starting timed out. Stopping.", u->id);
                 socket_enter_stop_pre(s, false);
                 break;
 
         case SOCKET_STOP_PRE:
                 socket_enter_stop_pre(s, false);
                 break;
 
         case SOCKET_STOP_PRE:
-                log_warning("%s stopping timed out. Terminating.", u->meta.id);
+                log_warning("%s stopping timed out. Terminating.", u->id);
                 socket_enter_signal(s, SOCKET_STOP_PRE_SIGTERM, false);
                 break;
 
         case SOCKET_STOP_PRE_SIGTERM:
                 if (s->exec_context.send_sigkill) {
                 socket_enter_signal(s, SOCKET_STOP_PRE_SIGTERM, false);
                 break;
 
         case SOCKET_STOP_PRE_SIGTERM:
                 if (s->exec_context.send_sigkill) {
-                        log_warning("%s stopping timed out. Killing.", u->meta.id);
+                        log_warning("%s stopping timed out. Killing.", u->id);
                         socket_enter_signal(s, SOCKET_STOP_PRE_SIGKILL, false);
                 } else {
                         socket_enter_signal(s, SOCKET_STOP_PRE_SIGKILL, false);
                 } else {
-                        log_warning("%s stopping timed out. Skipping SIGKILL. Ignoring.", u->meta.id);
+                        log_warning("%s stopping timed out. Skipping SIGKILL. Ignoring.", u->id);
                         socket_enter_stop_post(s, false);
                 }
                 break;
 
         case SOCKET_STOP_PRE_SIGKILL:
                         socket_enter_stop_post(s, false);
                 }
                 break;
 
         case SOCKET_STOP_PRE_SIGKILL:
-                log_warning("%s still around after SIGKILL. Ignoring.", u->meta.id);
+                log_warning("%s still around after SIGKILL. Ignoring.", u->id);
                 socket_enter_stop_post(s, false);
                 break;
 
         case SOCKET_STOP_POST:
                 socket_enter_stop_post(s, false);
                 break;
 
         case SOCKET_STOP_POST:
-                log_warning("%s stopping timed out (2). Terminating.", u->meta.id);
+                log_warning("%s stopping timed out (2). Terminating.", u->id);
                 socket_enter_signal(s, SOCKET_FINAL_SIGTERM, false);
                 break;
 
         case SOCKET_FINAL_SIGTERM:
                 if (s->exec_context.send_sigkill) {
                 socket_enter_signal(s, SOCKET_FINAL_SIGTERM, false);
                 break;
 
         case SOCKET_FINAL_SIGTERM:
                 if (s->exec_context.send_sigkill) {
-                        log_warning("%s stopping timed out (2). Killing.", u->meta.id);
+                        log_warning("%s stopping timed out (2). Killing.", u->id);
                         socket_enter_signal(s, SOCKET_FINAL_SIGKILL, false);
                 } else {
                         socket_enter_signal(s, SOCKET_FINAL_SIGKILL, false);
                 } else {
-                        log_warning("%s stopping timed out (2). Skipping SIGKILL. Ignoring.", u->meta.id);
+                        log_warning("%s stopping timed out (2). Skipping SIGKILL. Ignoring.", u->id);
                         socket_enter_dead(s, false);
                 }
                 break;
 
         case SOCKET_FINAL_SIGKILL:
                         socket_enter_dead(s, false);
                 }
                 break;
 
         case SOCKET_FINAL_SIGKILL:
-                log_warning("%s still around after SIGKILL (2). Entering failed mode.", u->meta.id);
+                log_warning("%s still around after SIGKILL (2). Entering failed mode.", u->id);
                 socket_enter_dead(s, false);
                 break;
 
                 socket_enter_dead(s, false);
                 break;
 
index 4fc2cbe..b6df83a 100644 (file)
@@ -77,7 +77,7 @@ typedef struct SocketPort {
 } SocketPort;
 
 struct Socket {
 } SocketPort;
 
 struct Socket {
-        Meta meta;
+        Unit meta;
 
         LIST_HEAD(SocketPort, ports);
 
 
         LIST_HEAD(SocketPort, ports);
 
index 202c4e6..87be552 100644 (file)
@@ -83,8 +83,8 @@ static void swap_init(Unit *u) {
         s->timeout_usec = DEFAULT_TIMEOUT_USEC;
 
         exec_context_init(&s->exec_context);
         s->timeout_usec = DEFAULT_TIMEOUT_USEC;
 
         exec_context_init(&s->exec_context);
-        s->exec_context.std_output = u->meta.manager->default_std_output;
-        s->exec_context.std_error = u->meta.manager->default_std_error;
+        s->exec_context.std_output = u->manager->default_std_output;
+        s->exec_context.std_error = u->manager->default_std_error;
 
         s->parameters_etc_fstab.priority = s->parameters_proc_swaps.priority = s->parameters_fragment.priority = -1;
 
 
         s->parameters_etc_fstab.priority = s->parameters_proc_swaps.priority = s->parameters_fragment.priority = -1;
 
@@ -151,7 +151,7 @@ int swap_add_one_mount_link(Swap *s, Mount *m) {
 }
 
 static int swap_add_mount_links(Swap *s) {
 }
 
 static int swap_add_mount_links(Swap *s) {
-        Meta *other;
+        Unit *other;
         int r;
 
         assert(s);
         int r;
 
         assert(s);
@@ -262,13 +262,13 @@ static int swap_load(Unit *u) {
         Swap *s = SWAP(u);
 
         assert(s);
         Swap *s = SWAP(u);
 
         assert(s);
-        assert(u->meta.load_state == UNIT_STUB);
+        assert(u->load_state == UNIT_STUB);
 
         /* Load a .swap file */
         if ((r = unit_load_fragment_and_dropin_optional(u)) < 0)
                 return r;
 
 
         /* Load a .swap file */
         if ((r = unit_load_fragment_and_dropin_optional(u)) < 0)
                 return r;
 
-        if (u->meta.load_state == UNIT_LOADED) {
+        if (u->load_state == UNIT_LOADED) {
                 if ((r = unit_add_exec_dependencies(u, &s->exec_context)) < 0)
                         return r;
 
                 if ((r = unit_add_exec_dependencies(u, &s->exec_context)) < 0)
                         return r;
 
@@ -283,7 +283,7 @@ static int swap_load(Unit *u) {
                         else if (s->parameters_proc_swaps.what)
                                 s->what = strdup(s->parameters_proc_swaps.what);
                         else
                         else if (s->parameters_proc_swaps.what)
                                 s->what = strdup(s->parameters_proc_swaps.what);
                         else
-                                s->what = unit_name_to_path(u->meta.id);
+                                s->what = unit_name_to_path(u->id);
 
                         if (!s->what)
                                 return -ENOMEM;
 
                         if (!s->what)
                                 return -ENOMEM;
@@ -952,7 +952,7 @@ static void swap_sigchld_event(Unit *u, pid_t pid, int code, int status) {
         }
 
         log_full(success ? LOG_DEBUG : LOG_NOTICE,
         }
 
         log_full(success ? LOG_DEBUG : LOG_NOTICE,
-                 "%s swap process exited, code=%s status=%i", u->meta.id, sigchld_code_to_string(code), status);
+                 "%s swap process exited, code=%s status=%i", u->id, sigchld_code_to_string(code), status);
 
         switch (s->state) {
 
 
         switch (s->state) {
 
@@ -985,7 +985,7 @@ static void swap_sigchld_event(Unit *u, pid_t pid, int code, int status) {
 
         /* Request a reload of /proc/swaps, so that following units
          * can follow our state change */
 
         /* Request a reload of /proc/swaps, so that following units
          * can follow our state change */
-        u->meta.manager->request_reload = true;
+        u->manager->request_reload = true;
 }
 
 static void swap_timer_event(Unit *u, uint64_t elapsed, Watch *w) {
 }
 
 static void swap_timer_event(Unit *u, uint64_t elapsed, Watch *w) {
@@ -998,38 +998,38 @@ static void swap_timer_event(Unit *u, uint64_t elapsed, Watch *w) {
         switch (s->state) {
 
         case SWAP_ACTIVATING:
         switch (s->state) {
 
         case SWAP_ACTIVATING:
-                log_warning("%s activation timed out. Stopping.", u->meta.id);
+                log_warning("%s activation timed out. Stopping.", u->id);
                 swap_enter_signal(s, SWAP_ACTIVATING_SIGTERM, false);
                 break;
 
         case SWAP_DEACTIVATING:
                 swap_enter_signal(s, SWAP_ACTIVATING_SIGTERM, false);
                 break;
 
         case SWAP_DEACTIVATING:
-                log_warning("%s deactivation timed out. Stopping.", u->meta.id);
+                log_warning("%s deactivation timed out. Stopping.", u->id);
                 swap_enter_signal(s, SWAP_DEACTIVATING_SIGTERM, false);
                 break;
 
         case SWAP_ACTIVATING_SIGTERM:
                 if (s->exec_context.send_sigkill) {
                 swap_enter_signal(s, SWAP_DEACTIVATING_SIGTERM, false);
                 break;
 
         case SWAP_ACTIVATING_SIGTERM:
                 if (s->exec_context.send_sigkill) {
-                        log_warning("%s activation timed out. Killing.", u->meta.id);
+                        log_warning("%s activation timed out. Killing.", u->id);
                         swap_enter_signal(s, SWAP_ACTIVATING_SIGKILL, false);
                 } else {
                         swap_enter_signal(s, SWAP_ACTIVATING_SIGKILL, false);
                 } else {
-                        log_warning("%s activation timed out. Skipping SIGKILL. Ignoring.", u->meta.id);
+                        log_warning("%s activation timed out. Skipping SIGKILL. Ignoring.", u->id);
                         swap_enter_dead(s, false);
                 }
                 break;
 
         case SWAP_DEACTIVATING_SIGTERM:
                 if (s->exec_context.send_sigkill) {
                         swap_enter_dead(s, false);
                 }
                 break;
 
         case SWAP_DEACTIVATING_SIGTERM:
                 if (s->exec_context.send_sigkill) {
-                        log_warning("%s deactivation timed out. Killing.", u->meta.id);
+                        log_warning("%s deactivation timed out. Killing.", u->id);
                         swap_enter_signal(s, SWAP_DEACTIVATING_SIGKILL, false);
                 } else {
                         swap_enter_signal(s, SWAP_DEACTIVATING_SIGKILL, false);
                 } else {
-                        log_warning("%s deactivation timed out. Skipping SIGKILL. Ignoring.", u->meta.id);
+                        log_warning("%s deactivation timed out. Skipping SIGKILL. Ignoring.", u->id);
                         swap_enter_dead(s, false);
                 }
                 break;
 
         case SWAP_ACTIVATING_SIGKILL:
         case SWAP_DEACTIVATING_SIGKILL:
                         swap_enter_dead(s, false);
                 }
                 break;
 
         case SWAP_ACTIVATING_SIGKILL:
         case SWAP_DEACTIVATING_SIGKILL:
-                log_warning("%s swap process still around after SIGKILL. Ignoring.", u->meta.id);
+                log_warning("%s swap process still around after SIGKILL. Ignoring.", u->id);
                 swap_enter_dead(s, false);
                 break;
 
                 swap_enter_dead(s, false);
                 break;
 
@@ -1096,7 +1096,7 @@ int swap_dispatch_reload(Manager *m) {
 }
 
 int swap_fd_event(Manager *m, int events) {
 }
 
 int swap_fd_event(Manager *m, int events) {
-        Meta *meta;
+        Unit *meta;
         int r;