diff options
Diffstat (limited to 'src/dbus-mount.c')
-rw-r--r-- | src/dbus-mount.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/src/dbus-mount.c b/src/dbus-mount.c index 60f1e92415..17d29d6e48 100644 --- a/src/dbus-mount.c +++ b/src/dbus-mount.c @@ -135,23 +135,29 @@ static int bus_mount_append_type(DBusMessageIter *i, const char *property, void return 0; } +static const BusProperty bus_mount_properties[] = { + { "Where", bus_property_append_string, "s", offsetof(Mount, where), true }, + { "What", bus_mount_append_what, "s", 0 }, + { "Options", bus_mount_append_options, "s", 0 }, + { "Type", bus_mount_append_type, "s", 0 }, + { "TimeoutUSec", bus_property_append_usec, "t", offsetof(Mount, timeout_usec) }, + BUS_EXEC_COMMAND_PROPERTY("ExecMount", offsetof(Mount, exec_command[MOUNT_EXEC_MOUNT]), false), + BUS_EXEC_COMMAND_PROPERTY("ExecUnmount", offsetof(Mount, exec_command[MOUNT_EXEC_UNMOUNT]), false), + BUS_EXEC_COMMAND_PROPERTY("ExecRemount", offsetof(Mount, exec_command[MOUNT_EXEC_REMOUNT]), false), + { "ControlPID", bus_property_append_pid, "u", offsetof(Mount, control_pid) }, + { "DirectoryMode", bus_property_append_mode, "u", offsetof(Mount, directory_mode) }, + { NULL, } +}; + DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) { Mount *m = MOUNT(u); - const BusProperty properties[] = { - BUS_UNIT_PROPERTIES, - { "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", "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 } + + const BusBoundProperties bps[] = { + { "org.freedesktop.systemd1.Unit", bus_unit_properties, u }, + { "org.freedesktop.systemd1.Mount", bus_mount_properties, m }, + { "org.freedesktop.systemd1.Mount", bus_exec_context_properties, &m->exec_context }, + { NULL, } }; - return bus_default_message_handler(c, message, INTROSPECTION, INTERFACES_LIST, properties); + return bus_default_message_handler(c, message, INTROSPECTION, INTERFACES_LIST, bps ); } |