#include "snapshot.h"
#include "unit-name.h"
#include "dbus-snapshot.h"
-#include "bus-errors.h"
+#include "bus-common-errors.h"
static const UnitActiveState state_translation_table[_SNAPSHOT_STATE_MAX] = {
[SNAPSHOT_DEAD] = UNIT_INACTIVE,
s->state = state;
if (state != old_state)
- log_debug_unit(UNIT(s)->id,
+ log_unit_debug(UNIT(s)->id,
"%s changed %s -> %s",
UNIT(s)->id,
snapshot_state_to_string(old_state),
if (s->cleanup)
unit_add_to_cleanup_queue(u);
- return 0;
+ return 1;
}
static int snapshot_stop(Unit *u) {
assert(s->state == SNAPSHOT_ACTIVE);
snapshot_set_state(s, SNAPSHOT_DEAD);
- return 0;
+ return 1;
}
static int snapshot_serialize(Unit *u, FILE *f, FDSet *fds) {
state = snapshot_state_from_string(value);
if (state < 0)
- log_debug_unit(u->id, "Failed to parse state value %s", value);
+ log_unit_debug(u->id, "Failed to parse state value %s", value);
else
s->deserialized_state = state;
r = parse_boolean(value);
if (r < 0)
- log_debug_unit(u->id, "Failed to parse cleanup value %s", value);
+ log_unit_debug(u->id, "Failed to parse cleanup value %s", value);
else
s->cleanup = r;
if (r < 0)
return r;
} else
- log_debug_unit(u->id, "Unknown serialization key '%s'", key);
+ log_unit_debug(u->id, "Unknown serialization key '%s'", key);
return 0;
}
SNAPSHOT(u)->cleanup = cleanup;
*_s = SNAPSHOT(u);
- log_info_unit(u->id, "Created snapshot %s.", u->id);
+ log_unit_info(u->id, "Created snapshot %s.", u->id);
return 0;
void snapshot_remove(Snapshot *s) {
assert(s);
- log_info_unit(UNIT(s)->id, "Removing snapshot %s.", UNIT(s)->id);
+ log_unit_info(UNIT(s)->id, "Removing snapshot %s.", UNIT(s)->id);
unit_add_to_cleanup_queue(UNIT(s));
}