1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

pid1: drop redundant DBus properties

Follow-up for 10f3f4ed01.

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.
This commit is contained in:
Yu Watanabe 2022-09-16 21:50:58 +09:00
parent 9341f41801
commit 3e911a0d0e
4 changed files with 21 additions and 47 deletions

View 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>

View 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),

View 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;

View 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);