]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1: drop redundant DBus properties 24688/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Sep 2022 12:50:58 +0000 (21:50 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Sep 2022 12:53:28 +0000 (21:53 +0900)
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.

man/org.freedesktop.systemd1.xml
src/core/dbus-manager.c
src/shared/watchdog.c
src/shared/watchdog.h

index 919df52135ac2c6a638e2f7343af5c9add53fb1b..364fb9de03623ba98bf0d7679bd64a4618cbaf77 100644 (file)
@@ -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>
index 3486bab84bab0e27f0f26a4e63f203b5ebd469ab..473c0bc5abbc8ac68c4b35949a9948c5481a970e 100644 (file)
@@ -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),
index 93939654b228195cdb875b217c766e5f5836ff42..0031e13f64e21ec886eb5c18cbe87a611663fd85 100644 (file)
@@ -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;
 
index 1242fbc4d9ea3221b93937d5a6527e1e5f403753..a0a80efc9762081d5df73b3f059edd63f1a21710 100644 (file)
@@ -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);