diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-09-16 14:50:58 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-09-16 14:53:28 +0200 |
commit | 3e911a0d0e867731fae28c0e777234c2882f263b (patch) | |
tree | d790cf5c52380939d8e634335c15f0736225c270 | |
parent | watchdog: explicitly initialize global variable (diff) | |
download | systemd-3e911a0d0e867731fae28c0e777234c2882f263b.tar.xz systemd-3e911a0d0e867731fae28c0e777234c2882f263b.zip |
pid1: drop redundant DBus properties
Follow-up for 10f3f4ed016b9fe92ca3d093fcfaed8278e69220.
We already have RuntimeWatchdogUSec or friends. Let's not introduce
redundant properties.
Also, drop the const qualifier for WatchdogLastPingTimestamp, as they
are actually not constant.
-rw-r--r-- | man/org.freedesktop.systemd1.xml | 48 | ||||
-rw-r--r-- | src/core/dbus-manager.c | 10 | ||||
-rw-r--r-- | src/shared/watchdog.c | 8 | ||||
-rw-r--r-- | src/shared/watchdog.h | 2 |
4 files changed, 21 insertions, 47 deletions
diff --git a/man/org.freedesktop.systemd1.xml b/man/org.freedesktop.systemd1.xml index 919df52135..364fb9de03 100644 --- a/man/org.freedesktop.systemd1.xml +++ b/man/org.freedesktop.systemd1.xml @@ -393,6 +393,12 @@ node /org/freedesktop/systemd1 { readonly s DefaultStandardOutput = '...'; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") readonly s DefaultStandardError = '...'; + @org.freedesktop.DBus.Property.EmitsChangedSignal("const") + readonly s WatchdogDevice = '...'; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly t WatchdogLastPingTimestamp = ...; + @org.freedesktop.DBus.Property.EmitsChangedSignal("false") + readonly t WatchdogLastPingTimestampMonotonic = ...; @org.freedesktop.DBus.Property.EmitsChangedSignal("false") @org.freedesktop.systemd1.Privileged("true") readwrite t RuntimeWatchdogUSec = ...; @@ -515,16 +521,6 @@ node /org/freedesktop/systemd1 { readonly i DefaultOOMScoreAdjust = ...; @org.freedesktop.DBus.Property.EmitsChangedSignal("const") readonly s CtrlAltDelBurstAction = '...'; - @org.freedesktop.DBus.Property.EmitsChangedSignal("const") - readonly s WatchdogDevice = '...'; - @org.freedesktop.DBus.Property.EmitsChangedSignal("const") - readonly t WatchdogTimeoutUsec = ...; - @org.freedesktop.DBus.Property.EmitsChangedSignal("const") - readonly t WatchdogPreTimeoutUsec = ...; - @org.freedesktop.DBus.Property.EmitsChangedSignal("const") - readonly t WatchdogLastPingTimestamp = ...; - @org.freedesktop.DBus.Property.EmitsChangedSignal("const") - readonly t WatchdogLastPingTimestampMonotonic = ...; }; interface org.freedesktop.DBus.Peer { ... }; interface org.freedesktop.DBus.Introspectable { ... }; @@ -662,6 +658,12 @@ node /org/freedesktop/systemd1 { <!--property DefaultStandardError is not documented!--> + <!--property WatchdogDevice is not documented!--> + + <!--property WatchdogLastPingTimestamp is not documented!--> + + <!--property WatchdogLastPingTimestampMonotonic is not documented!--> + <!--property RuntimeWatchdogUSec is not documented!--> <!--property RuntimeWatchdogPreUSec is not documented!--> @@ -776,16 +778,6 @@ node /org/freedesktop/systemd1 { <!--property CtrlAltDelBurstAction is not documented!--> - <!--property WatchdogDevice is not documented!--> - - <!--property WatchdogTimeoutUsec is not documented!--> - - <!--property WatchdogPreTimeoutUsec is not documented!--> - - <!--property WatchdogLastPingTimestamp is not documented!--> - - <!--property WatchdogLastPingTimestampMonotonic is not documented!--> - <!--Autogenerated cross-references for systemd.directives, do not edit--> <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.systemd1.Manager"/> @@ -1080,6 +1072,12 @@ node /org/freedesktop/systemd1 { <variablelist class="dbus-property" generated="True" extra-ref="DefaultStandardError"/> + <variablelist class="dbus-property" generated="True" extra-ref="WatchdogDevice"/> + + <variablelist class="dbus-property" generated="True" extra-ref="WatchdogLastPingTimestamp"/> + + <variablelist class="dbus-property" generated="True" extra-ref="WatchdogLastPingTimestampMonotonic"/> + <variablelist class="dbus-property" generated="True" extra-ref="RuntimeWatchdogUSec"/> <variablelist class="dbus-property" generated="True" extra-ref="RuntimeWatchdogPreUSec"/> @@ -1196,16 +1194,6 @@ node /org/freedesktop/systemd1 { <variablelist class="dbus-property" generated="True" extra-ref="CtrlAltDelBurstAction"/> - <variablelist class="dbus-property" generated="True" extra-ref="WatchdogDevice"/> - - <variablelist class="dbus-property" generated="True" extra-ref="WatchdogTimeoutUsec"/> - - <variablelist class="dbus-property" generated="True" extra-ref="WatchdogPreTimeoutUsec"/> - - <variablelist class="dbus-property" generated="True" extra-ref="WatchdogLastPingTimestamp"/> - - <variablelist class="dbus-property" generated="True" extra-ref="WatchdogLastPingTimestampMonotonic"/> - <!--End of Autogenerated section--> <refsect2> diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 3486bab84b..473c0bc5ab 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -62,8 +62,6 @@ static BUS_DEFINE_PROPERTY_GET_REF(property_get_hashmap_size, "u", Hashmap *, ha static BUS_DEFINE_PROPERTY_GET_REF(property_get_set_size, "u", Set *, set_size); static BUS_DEFINE_PROPERTY_GET(property_get_default_timeout_abort_usec, "t", Manager, manager_default_timeout_abort_usec); static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_watchdog_device, "s", watchdog_get_device()); -static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_watchdog_timeout, "t", watchdog_get_timeout()); -static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_watchdog_pretimeout, "t", watchdog_get_pretimeout()); static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_watchdog_last_ping_realtime, "t", watchdog_get_last_ping(CLOCK_REALTIME)); static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_watchdog_last_ping_monotonic, "t", watchdog_get_last_ping(CLOCK_MONOTONIC)); @@ -2725,6 +2723,9 @@ const sd_bus_vtable bus_manager_vtable[] = { SD_BUS_PROPERTY("UnitPath", "as", NULL, offsetof(Manager, lookup_paths.search_path), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("DefaultStandardOutput", "s", bus_property_get_exec_output, offsetof(Manager, default_std_output), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("DefaultStandardError", "s", bus_property_get_exec_output, offsetof(Manager, default_std_error), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("WatchdogDevice", "s", property_get_watchdog_device, 0, SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("WatchdogLastPingTimestamp", "t", property_get_watchdog_last_ping_realtime, 0, 0), + SD_BUS_PROPERTY("WatchdogLastPingTimestampMonotonic", "t", property_get_watchdog_last_ping_monotonic, 0, 0), SD_BUS_WRITABLE_PROPERTY("RuntimeWatchdogUSec", "t", property_get_runtime_watchdog, property_set_runtime_watchdog, 0, 0), SD_BUS_WRITABLE_PROPERTY("RuntimeWatchdogPreUSec", "t", property_get_pretimeout_watchdog, property_set_pretimeout_watchdog, 0, 0), SD_BUS_WRITABLE_PROPERTY("RuntimeWatchdogPreGovernor", "s", property_get_pretimeout_watchdog_governor, property_set_pretimeout_watchdog_governor, 0, 0), @@ -2788,11 +2789,6 @@ const sd_bus_vtable bus_manager_vtable[] = { SD_BUS_PROPERTY("DefaultOOMPolicy", "s", bus_property_get_oom_policy, offsetof(Manager, default_oom_policy), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("DefaultOOMScoreAdjust", "i", property_get_oom_score_adjust, 0, SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("CtrlAltDelBurstAction", "s", bus_property_get_emergency_action, offsetof(Manager, cad_burst_action), SD_BUS_VTABLE_PROPERTY_CONST), - SD_BUS_PROPERTY("WatchdogDevice", "s", property_get_watchdog_device, 0, SD_BUS_VTABLE_PROPERTY_CONST), - SD_BUS_PROPERTY("WatchdogTimeoutUsec", "t", property_get_watchdog_timeout, 0, SD_BUS_VTABLE_PROPERTY_CONST), - SD_BUS_PROPERTY("WatchdogPreTimeoutUsec", "t", property_get_watchdog_pretimeout, 0, SD_BUS_VTABLE_PROPERTY_CONST), - SD_BUS_PROPERTY("WatchdogLastPingTimestamp", "t", property_get_watchdog_last_ping_realtime, 0, SD_BUS_VTABLE_PROPERTY_CONST), - SD_BUS_PROPERTY("WatchdogLastPingTimestampMonotonic", "t", property_get_watchdog_last_ping_monotonic, 0, SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_METHOD_WITH_ARGS("GetUnit", SD_BUS_ARGS("s", name), diff --git a/src/shared/watchdog.c b/src/shared/watchdog.c index 93939654b2..0031e13f64 100644 --- a/src/shared/watchdog.c +++ b/src/shared/watchdog.c @@ -119,10 +119,6 @@ static int watchdog_set_enable(bool enable) { return 0; } -usec_t watchdog_get_timeout(void) { - return watchdog_timeout; -} - static int watchdog_read_timeout(void) { int sec = 0; @@ -154,10 +150,6 @@ static int watchdog_set_timeout(void) { return 0; } -usec_t watchdog_get_pretimeout(void) { - return watchdog_pretimeout; -} - static int watchdog_read_pretimeout(void) { int sec = 0; diff --git a/src/shared/watchdog.h b/src/shared/watchdog.h index 1242fbc4d9..a0a80efc97 100644 --- a/src/shared/watchdog.h +++ b/src/shared/watchdog.h @@ -7,8 +7,6 @@ #include "util.h" const char *watchdog_get_device(void); -usec_t watchdog_get_timeout(void); -usec_t watchdog_get_pretimeout(void); usec_t watchdog_get_last_ping(clockid_t clock); int watchdog_set_device(const char *path); |