diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-10-28 14:24:46 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-10-28 14:31:25 +0100 |
commit | 47cb901e38cd7092576fc8e76cc4a14f39bf719d (patch) | |
tree | 7ca11b696f63e7ce2467139c455c89a47487101d /src/core/dbus-swap.c | |
parent | 33488f19793dc0a86fdee27266c5319b5b78d695 (diff) |
swap: replace Discard= setting by a more generic Options= setting
For now, it's systemd itself that parses the options string, but as soon
as util-linux' swapon can take the option string directly with -o we
should pass it on unmodified.
Diffstat (limited to 'src/core/dbus-swap.c')
-rw-r--r-- | src/core/dbus-swap.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/dbus-swap.c b/src/core/dbus-swap.c index c854716b48..1e7f66d053 100644 --- a/src/core/dbus-swap.c +++ b/src/core/dbus-swap.c @@ -55,7 +55,7 @@ static int property_get_priority( return sd_bus_message_append(reply, "i", p); } -static int property_get_discard( +static int property_get_options( sd_bus *bus, const char *path, const char *interface, @@ -65,17 +65,16 @@ static int property_get_discard( sd_bus_error *error) { Swap *s = SWAP(userdata); - const char *p; + const char *options = NULL; assert(bus); assert(reply); assert(s); if (s->from_fragment) - p = s->parameters_fragment.discard ?: "none"; - else - p = "none"; - return sd_bus_message_append(reply, "s", p); + options = s->parameters_fragment.options; + + return sd_bus_message_append(reply, "s", options); } static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, swap_result, SwapResult); @@ -84,7 +83,7 @@ const sd_bus_vtable bus_swap_vtable[] = { SD_BUS_VTABLE_START(0), SD_BUS_PROPERTY("What", "s", NULL, offsetof(Swap, what), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("Priority", "i", property_get_priority, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), - SD_BUS_PROPERTY("Discard", "s", property_get_discard, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), + SD_BUS_PROPERTY("Options", "s", property_get_options, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("TimeoutUSec", "t", bus_property_get_usec, offsetof(Swap, timeout_usec), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("ControlPID", "u", bus_property_get_pid, offsetof(Swap, control_pid), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Swap, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), |