Snapshot *s = SNAPSHOT(u);
assert(s);
- assert(s->meta.load_state == UNIT_STUB);
+ assert(UNIT(s)->load_state == UNIT_STUB);
- s->meta.ignore_on_isolate = true;
- s->meta.ignore_on_snapshot = true;
+ UNIT(s)->ignore_on_isolate = true;
+ UNIT(s)->ignore_on_snapshot = true;
}
static void snapshot_set_state(Snapshot *s, SnapshotState state) {
if (state != old_state)
log_debug("%s changed %s -> %s",
- s->meta.id,
+ UNIT(s)->id,
snapshot_state_to_string(old_state),
snapshot_state_to_string(state));
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_deserializing <= 0)
+ if (!s->by_snapshot_create && UNIT(s)->manager->n_reloading <= 0)
return -ENOENT;
- u->meta.load_state = UNIT_LOADED;
+ u->load_state = UNIT_LOADED;
return 0;
}
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;
}
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) {
- if (other->meta.ignore_on_snapshot)
+ if (other->ignore_on_snapshot)
continue;
- if (k != other->meta.id)
+ if (k != other->id)
continue;
if (UNIT_VTABLE(other)->check_snapshot)
const UnitVTable snapshot_vtable = {
.suffix = ".snapshot",
+ .object_size = sizeof(Snapshot),
.no_alias = true,
.no_instances = true,