diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-10-26 22:05:52 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-10-26 22:05:52 +0200 |
commit | 15412f2987c0f0a562f9cf8edcca023f90a5f5bd (patch) | |
tree | 4aa8e45a7ee1c4f427e12421fc43e0e009ef3621 /src/dbus-swap.c | |
parent | de58283f71162d3e6522b67e044f8f9ee9fdf066 (diff) |
swap: expose swap exec env proprties via dbus
Diffstat (limited to 'src/dbus-swap.c')
-rw-r--r-- | src/dbus-swap.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/dbus-swap.c b/src/dbus-swap.c index c345d4bc7d..70cccdcab8 100644 --- a/src/dbus-swap.c +++ b/src/dbus-swap.c @@ -24,11 +24,17 @@ #include "dbus-unit.h" #include "dbus-swap.h" +#include "dbus-execute.h" #define BUS_SWAP_INTERFACE \ " <interface name=\"org.freedesktop.systemd1.Swap\">\n" \ " <property name=\"What\" type=\"s\" access=\"read\"/>\n" \ " <property name=\"Priority\" type=\"i\" access=\"read\"/>\n" \ + " <property name=\"TimeoutUSec\" type=\"t\" access=\"read\"/>\n" \ + BUS_EXEC_COMMAND_INTERFACE("ExecActivate") \ + BUS_EXEC_COMMAND_INTERFACE("ExecDeactivate") \ + BUS_EXEC_CONTEXT_INTERFACE \ + " <property name=\"ControlPID\" type=\"u\" access=\"read\"/>\n" \ " </interface>\n" #define INTROSPECTION \ @@ -46,6 +52,9 @@ const char bus_swap_interface[] = BUS_SWAP_INTERFACE; const char bus_swap_invalidating_properties[] = "What\0" "Priority\0" + "ExecActivate\0" + "ExecDeactivate\0" + "ControlPID\0" "\0"; static int bus_swap_append_priority(Manager *m, DBusMessageIter *i, const char *property, void *data) { @@ -75,8 +84,12 @@ static int bus_swap_append_priority(Manager *m, DBusMessageIter *i, const char * DBusHandlerResult bus_swap_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) { 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 }, + { "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 }, { NULL, NULL, NULL, NULL, NULL } }; |