-static const BusProperty bus_snapshot_properties[] = {
- { "Cleanup", bus_property_append_bool, "b", offsetof(Snapshot, cleanup) },
- { NULL, }
-};
-
-DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
- Snapshot *s = SNAPSHOT(u);
-
- DBusMessage *reply = NULL;
- DBusError error;
-
- dbus_error_init(&error);
-
- if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Snapshot", "Remove")) {
-
- snapshot_remove(SNAPSHOT(u));
-
- if (!(reply = dbus_message_new_method_return(message)))
- goto oom;
-
- } else {
- const BusBoundProperties bps[] = {
- { "org.freedesktop.systemd1.Unit", bus_unit_properties, u },
- { "org.freedesktop.systemd1.Snapshot", bus_snapshot_properties, s },
- { NULL, }
- };
- return bus_default_message_handler(c, message, INTROSPECTION, INTERFACES_LIST, bps);
- }
-
- if (reply) {
- if (!dbus_connection_send(c, reply, NULL))
- goto oom;
-
- dbus_message_unref(reply);
- }
-
- return DBUS_HANDLER_RESULT_HANDLED;
-
-oom:
- if (reply)
- dbus_message_unref(reply);
-
- dbus_error_free(&error);
-
- return DBUS_HANDLER_RESULT_NEED_MEMORY;