]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: no need to list properties for PropertiesChanged messages anymore
authorLennart Poettering <lennart@poettering.net>
Sun, 22 Dec 2013 02:43:03 +0000 (03:43 +0100)
committerLennart Poettering <lennart@poettering.net>
Sun, 22 Dec 2013 02:50:52 +0000 (03:50 +0100)
Since the vtable includes this information anyway, let's just use that

32 files changed:
src/core/automount.c
src/core/busname.c
src/core/dbus-automount.c
src/core/dbus-automount.h
src/core/dbus-busname.c
src/core/dbus-busname.h
src/core/dbus-device.c
src/core/dbus-device.h
src/core/dbus-mount.c
src/core/dbus-mount.h
src/core/dbus-path.c
src/core/dbus-path.h
src/core/dbus-scope.c
src/core/dbus-scope.h
src/core/dbus-service.c
src/core/dbus-service.h
src/core/dbus-socket.c
src/core/dbus-socket.h
src/core/dbus-swap.c
src/core/dbus-swap.h
src/core/dbus-timer.c
src/core/dbus-timer.h
src/core/dbus-unit.c
src/core/device.c
src/core/mount.c
src/core/path.c
src/core/scope.c
src/core/service.c
src/core/socket.c
src/core/swap.c
src/core/timer.c
src/core/unit.h

index c6e0a74707c7648344798daa6bf9fed2083bb9e1..c44521c22e37206f76ba943ba682d86229884d0a 100644 (file)
@@ -874,7 +874,6 @@ const UnitVTable automount_vtable = {
 
         .bus_interface = "org.freedesktop.systemd1.Automount",
         .bus_vtable = bus_automount_vtable,
-        .bus_changing_properties = bus_automount_changing_properties,
 
         .shutdown = automount_shutdown,
 
index 034e5f60d12373a5fd9dbbbc91f83088b5bdf490..9b6bf07d9f55d1facaf870d8a79a9aa8b5b72c07 100644 (file)
@@ -584,7 +584,6 @@ const UnitVTable busname_vtable = {
 
         .bus_interface = "org.freedesktop.systemd1.BusName",
         .bus_vtable = bus_busname_vtable,
-        .bus_changing_properties = bus_busname_changing_properties,
 
         .status_message_formats = {
                 .finished_start_job = {
index 8559aed0ed9f604383e0f85102a1e6a46b707c0a..b2a510ad0905651ed4468c819204641bce21a0e3 100644 (file)
@@ -34,8 +34,3 @@ const sd_bus_vtable bus_automount_vtable[] = {
         SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Automount, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
         SD_BUS_VTABLE_END
 };
-
-const char* const bus_automount_changing_properties[] = {
-        "Result",
-        NULL
-};
index 0b9618368ed152c46166aa157f2348b7d1a25088..1bec95378801bd2b1c02dd97d5c4c435056b334b 100644 (file)
@@ -24,4 +24,3 @@
 #include "sd-bus.h"
 
 extern const sd_bus_vtable bus_automount_vtable[];
-extern const char* const bus_automount_changing_properties[];
index 9f94bf1d574790785068b859bd435bb1b9066300..854491b2ee60765b3a520e83a9546aeee0807429 100644 (file)
@@ -33,8 +33,3 @@ const sd_bus_vtable bus_busname_vtable[] = {
         SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(BusName, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
         SD_BUS_VTABLE_END
 };
-
-const char* const bus_busname_changing_properties[] = {
-        "Result",
-        NULL
-};
index 3a29317e1e667feb122715778d40de74a02d84dd..b5eed37d58ad8820408ba6b1c6dd273bced2737f 100644 (file)
@@ -25,4 +25,3 @@
 #include "unit.h"
 
 extern const sd_bus_vtable bus_busname_vtable[];
-extern const char* const bus_busname_changing_properties[];
index 621bab0426d2ffbf36693bc7734ab9dbfc25f205..f556536f33b0c4f05ea5dd70b47083eb94eccad1 100644 (file)
@@ -29,8 +29,3 @@ const sd_bus_vtable bus_device_vtable[] = {
         SD_BUS_PROPERTY("SysFSPath", "s", NULL, offsetof(Device, sysfs), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
         SD_BUS_VTABLE_END
 };
-
-const char* const bus_device_changing_properties[] = {
-        "SysFSPath",
-        NULL
-};
index f248c28db354c33340ff284c0b16fbae5fd1130e..4aff226ab26c806e6c790dca8faa9a92411484bb 100644 (file)
@@ -25,4 +25,3 @@
 #include "unit.h"
 
 extern const sd_bus_vtable bus_device_vtable[];
-extern const char* const bus_device_changing_properties[];
index 3b588087e6c978a3b6c1c40b677c98f33e33dc1b..28f0e9071eaa060fc017187bd09143a9666adc6e 100644 (file)
@@ -124,15 +124,6 @@ const sd_bus_vtable bus_mount_vtable[] = {
         SD_BUS_VTABLE_END
 };
 
-const char * const bus_mount_changing_properties[] = {
-        "What",
-        "Options",
-        "Type",
-        "ControlPID",
-        "Result",
-        NULL
-};
-
 int bus_mount_set_property(
                 Unit *u,
                 const char *name,
index 4bb5d2ddee10cd27afd8f2966b073858f878a6c0..f7004d252f02f311f0ff058252decb0702ae0ccb 100644 (file)
@@ -25,7 +25,6 @@
 #include "unit.h"
 
 extern const sd_bus_vtable bus_mount_vtable[];
-extern const char * const bus_mount_changing_properties[];
 
 int bus_mount_set_property(Unit *u, const char *name, sd_bus_message *message, UnitSetPropertiesMode mode, sd_bus_error *error);
 int bus_mount_commit_properties(Unit *u);
index 36c4e0f72cad4c6340aea35773424493b1dcd8e7..b5e894101daeb943a092f089093ce9b976f8250e 100644 (file)
@@ -86,8 +86,3 @@ const sd_bus_vtable bus_path_vtable[] = {
         SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Path, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
         SD_BUS_VTABLE_END
 };
-
-const char* const bus_path_changing_properties[] = {
-        "Result",
-        NULL
-};
index e9558f81b50b2cb6c008816a08ed60c1247cc9ea..667da052234cbe0c400b8f86e81e99445489f783 100644 (file)
@@ -25,4 +25,3 @@
 #include "sd-bus.h"
 
 extern const sd_bus_vtable bus_path_vtable[];
-extern const char* const bus_path_changing_properties[];
index b20b6e7ffeb0c72570da909f8094590aa425d5fd..bb251edc76ca11573da3ee5e10b9c9e806da59a6 100644 (file)
@@ -36,11 +36,6 @@ const sd_bus_vtable bus_scope_vtable[] = {
         SD_BUS_VTABLE_END
 };
 
-const char* const bus_scope_changing_properties[] = {
-        "Result",
-        NULL
-};
-
 static int bus_scope_set_transient_property(
                 Scope *s,
                 const char *name,
index 30c5e1e0a79efdb740ebfa14385bbcd81ae489b4..7e8f0053da0b1f3961054b70797948aa4b7cb7ad 100644 (file)
@@ -25,7 +25,6 @@
 #include "unit.h"
 
 extern const sd_bus_vtable bus_scope_vtable[];
-extern const char* const bus_scope_changing_properties[];
 
 int bus_scope_set_property(Unit *u, const char *name, sd_bus_message *i, UnitSetPropertiesMode mode, sd_bus_error *error);
 int bus_scope_commit_properties(Unit *u);
index 25af7acc2a01bd44b8d322883668294db5b56e40..3db9339d455c7c21ab10a1af28256e9ca6d5afdc 100644 (file)
@@ -69,21 +69,6 @@ const sd_bus_vtable bus_service_vtable[] = {
         SD_BUS_VTABLE_END
 };
 
-const char* const bus_service_changing_properties[] = {
-        "ExecMainStartTimestamp",
-        "ExecMainStartTimestampMonotonic",
-        "ExecMainExitTimestamp",
-        "ExecMainExitTimestampMonotonic",
-        "ExecMainPID",
-        "ExecMainCode",
-        "ExecMainStatus",
-        "MainPID",
-        "ControlPID",
-        "StatusText",
-        "Result",
-        NULL
-};
-
 static int bus_service_set_transient_property(
                 Service *s,
                 const char *name,
index 5fa9b2f139d7fd1e5faac1b241589903ef5bab07..aab9f7aa264a74827c6cce5020cf530e1f74921a 100644 (file)
@@ -25,7 +25,6 @@
 #include "unit.h"
 
 extern const sd_bus_vtable bus_service_vtable[];
-extern const char* const bus_service_changing_properties[];
 
 int bus_service_set_property(Unit *u, const char *name, sd_bus_message *i, UnitSetPropertiesMode mode, sd_bus_error *error);
 int bus_service_commit_properties(Unit *u);
index c64bf82e6104b7c538f2f12da3fff9c5b8ed6306..bb9d41990a2a1ce03ce6743dd27e7627600df445 100644 (file)
@@ -90,7 +90,6 @@ const sd_bus_vtable bus_socket_vtable[] = {
         SD_BUS_PROPERTY("BindIPv6Only", "s", property_get_bind_ipv6_only, offsetof(Socket, bind_ipv6_only), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("Backlog", "u", bus_property_get_unsigned, offsetof(Socket, backlog), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("TimeoutUSec", "t", bus_property_get_usec, offsetof(Socket, timeout_usec), SD_BUS_VTABLE_PROPERTY_CONST),
-        SD_BUS_PROPERTY("ControlPID", "u", bus_property_get_pid, offsetof(Socket, control_pid), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
         SD_BUS_PROPERTY("BindToDevice", "s", NULL, offsetof(Socket, bind_to_device), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("DirectoryMode", "u", bus_property_get_mode, offsetof(Socket, directory_mode), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("SocketMode", "u", bus_property_get_mode, offsetof(Socket, socket_mode), SD_BUS_VTABLE_PROPERTY_CONST),
@@ -110,15 +109,16 @@ const sd_bus_vtable bus_socket_vtable[] = {
         SD_BUS_PROPERTY("Listen", "a(ss)", property_get_listen, 0, SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("Mark", "i", bus_property_get_int, offsetof(Socket, mark), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("MaxConnections", "u", bus_property_get_unsigned, offsetof(Socket, max_connections), SD_BUS_VTABLE_PROPERTY_CONST),
-        SD_BUS_PROPERTY("NConnections", "u", bus_property_get_unsigned, offsetof(Socket, n_connections), 0),
-        SD_BUS_PROPERTY("NAccepted", "u", bus_property_get_unsigned, offsetof(Socket, n_accepted), 0),
         SD_BUS_PROPERTY("MessageQueueMaxMessages", "x", bus_property_get_long, offsetof(Socket, mq_maxmsg), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("MessageQueueMessageSize", "x", bus_property_get_long, offsetof(Socket, mq_msgsize), SD_BUS_VTABLE_PROPERTY_CONST),
-        SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Socket, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
         SD_BUS_PROPERTY("ReusePort", "b",  bus_property_get_bool, offsetof(Socket, reuse_port), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("SmackLabel", "s", NULL, offsetof(Socket, smack), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("SmackLabelIPIn", "s", NULL, offsetof(Socket, smack_ip_in), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("SmackLabelIPOut", "s", NULL, offsetof(Socket, smack_ip_out), SD_BUS_VTABLE_PROPERTY_CONST),
+        SD_BUS_PROPERTY("ControlPID", "u", bus_property_get_pid, offsetof(Socket, control_pid), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
+        SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Socket, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
+        SD_BUS_PROPERTY("NConnections", "u", bus_property_get_unsigned, offsetof(Socket, n_connections), 0),
+        SD_BUS_PROPERTY("NAccepted", "u", bus_property_get_unsigned, offsetof(Socket, n_accepted), 0),
         BUS_EXEC_COMMAND_LIST_VTABLE("ExecStartPre", offsetof(Socket, exec_command[SOCKET_EXEC_START_PRE]), SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION),
         BUS_EXEC_COMMAND_LIST_VTABLE("ExecStartPost", offsetof(Socket, exec_command[SOCKET_EXEC_START_POST]), SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION),
         BUS_EXEC_COMMAND_LIST_VTABLE("ExecStopPre", offsetof(Socket, exec_command[SOCKET_EXEC_STOP_PRE]), SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION),
@@ -126,14 +126,6 @@ const sd_bus_vtable bus_socket_vtable[] = {
         SD_BUS_VTABLE_END
 };
 
-const char* const bus_socket_changing_properties[] = {
-        "ControlPID",
-        "NAccepted",
-        "NConnections",
-        "Result",
-        NULL
-};
-
 int bus_socket_set_property(
                 Unit *u,
                 const char *name,
index 8808fa235502245895e8d07f115094b6074423b5..17164d98713266d0e130c3f2a3743dd9cbc5c4b7 100644 (file)
@@ -25,7 +25,6 @@
 #include "unit.h"
 
 extern const sd_bus_vtable bus_socket_vtable[];
-extern const char* const bus_socket_changing_properties[];
 
 int bus_socket_set_property(Unit *u, const char *name, sd_bus_message *message, UnitSetPropertiesMode mode, sd_bus_error *error);
 int bus_socket_commit_properties(Unit *u);
index bad53feb5f66ebbe0d73e368209efa590938a1d9..7bd05db4153187014c5ea354cd17bf27c1fdfbd7 100644 (file)
@@ -69,14 +69,6 @@ const sd_bus_vtable bus_swap_vtable[] = {
         SD_BUS_VTABLE_END
 };
 
-const char* const bus_swap_changing_properties[] = {
-        "What",
-        "Priority",
-        "ControlPID",
-        "Result",
-        NULL
-};
-
 int bus_swap_set_property(
                 Unit *u,
                 const char *name,
index 5d357377cd5c5b91980a2312d62cae88d3133006..9469f68ab89486618618978ccdafa533b3604517 100644 (file)
@@ -26,7 +26,6 @@
 #include "unit.h"
 
 extern const sd_bus_vtable bus_swap_vtable[];
-extern const char* const bus_swap_changing_properties[];
 
 int bus_swap_set_property(Unit *u, const char *name, sd_bus_message *message, UnitSetPropertiesMode mode, sd_bus_error *error);
 int bus_swap_commit_properties(Unit *u);
index b37c0d0f26386d5c5fc4d6d700231a6b1fbb1a04..277a45c0b28fb3563a93c82e5cf766eef0e9f369 100644 (file)
@@ -146,10 +146,3 @@ const sd_bus_vtable bus_timer_vtable[] = {
         SD_BUS_PROPERTY("AccuracyUSec", "t", bus_property_get_usec, offsetof(Timer, accuracy_usec), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_VTABLE_END
 };
-
-const char* const bus_timer_changing_properties[] = {
-        "NextElapseUSecRealtime",
-        "NextElapseUSecMonotonic",
-        "Result",
-        NULL
-};
index ddd311c626ca2ab7663e5782cc61c5feaf979302..cfff88e8b70a3b78da0cd232447db1068511e57a 100644 (file)
@@ -24,4 +24,3 @@
 #include "sd-bus.h"
 
 extern const sd_bus_vtable bus_timer_vtable[];
-extern const char* const bus_timer_changing_properties[];
index 7a566ff7f9156eedddc5d0b5104247df9e823a7a..4d3e3cc9ec643e8a1c4b4e262f929e88398d99c2 100644 (file)
@@ -634,29 +634,25 @@ static int send_changed_signal(sd_bus *bus, const char *destination, void *userd
          * type, then for the generic unit. The clients may rely on
          * this order to get atomic behavior if needed. */
 
-        if (UNIT_VTABLE(u)->bus_changing_properties) {
-
-                r = sd_bus_emit_properties_changed_strv(
-                                bus, p,
-                                UNIT_VTABLE(u)->bus_interface,
-                                (char**) UNIT_VTABLE(u)->bus_changing_properties);
-                if (r < 0)
-                        return r;
+        r = sd_bus_emit_properties_changed_strv(
+                        bus, p,
+                        UNIT_VTABLE(u)->bus_interface,
+                        NULL);
+        if (r < 0) {
+                log_warning("Failed to send out specific PropertiesChanged signal for %s: %s", u->id, strerror(-r));
+                return r;
         }
 
-        return sd_bus_emit_properties_changed(
+        r = sd_bus_emit_properties_changed_strv(
                         bus, p,
                         "org.freedesktop.systemd1.Unit",
-                        "ActiveState",
-                        "SubState",
-                        "InactiveExitTimestamp",
-                        "ActiveEnterTimestamp",
-                        "ActiveExitTimestamp",
-                        "InactiveEnterTimestamp",
-                        "Job",
-                        "ConditionResult",
-                        "ConditionTimestamp",
                         NULL);
+        if (r < 0) {
+                log_warning("Failed to send out generic PropertiesChanged signal for %s: %s", u->id, strerror(-r));
+                return r;
+        }
+
+        return 0;
 }
 
 void bus_unit_send_change_signal(Unit *u) {
index 72d98aea722cadaf0e18d669d556f78bae5e1b12..2c44dec777fec1611296d10621f53ef07537681d 100644 (file)
@@ -653,7 +653,6 @@ const UnitVTable device_vtable = {
         .sub_state_to_string = device_sub_state_to_string,
 
         .bus_interface = "org.freedesktop.systemd1.Device",
-        .bus_changing_properties = bus_device_changing_properties,
         .bus_vtable = bus_device_vtable,
 
         .following = device_following,
index 77493dbd3c40c4ca72a9a96e4a385490c6a4199d..2b7934e40412a9aa606af30b23c6179fbac1c909 100644 (file)
@@ -1793,7 +1793,6 @@ const UnitVTable mount_vtable = {
 
         .bus_interface = "org.freedesktop.systemd1.Mount",
         .bus_vtable = bus_mount_vtable,
-        .bus_changing_properties = bus_mount_changing_properties,
         .bus_set_property = bus_mount_set_property,
         .bus_commit_properties = bus_mount_commit_properties,
 
index 51e8d1dbcc7a92c67f909df056ac1872e9c9799d..fc7069e6c7a9cc2a7090816f712cf693a04e1fd2 100644 (file)
@@ -805,6 +805,5 @@ const UnitVTable path_vtable = {
         .reset_failed = path_reset_failed,
 
         .bus_interface = "org.freedesktop.systemd1.Path",
-        .bus_vtable = bus_path_vtable,
-        .bus_changing_properties = bus_path_changing_properties
+        .bus_vtable = bus_path_vtable
 };
index a3c94794b1eb4740df9cad886f799ba4ed3991c8..56c374660e6a8ae8f82d1dd6c03228af4003db8c 100644 (file)
@@ -492,7 +492,6 @@ const UnitVTable scope_vtable = {
 
         .bus_interface = "org.freedesktop.systemd1.Scope",
         .bus_vtable = bus_scope_vtable,
-        .bus_changing_properties = bus_scope_changing_properties,
         .bus_set_property = bus_scope_set_property,
         .bus_commit_properties = bus_scope_commit_properties,
 
index 6c82ced92ec9567f21eaa3aaa675a210a6baeb28..87eaa29378b369a19c4cf462588e4adf6a90be55 100644 (file)
@@ -3836,7 +3836,6 @@ const UnitVTable service_vtable = {
 
         .bus_interface = "org.freedesktop.systemd1.Service",
         .bus_vtable = bus_service_vtable,
-        .bus_changing_properties = bus_service_changing_properties,
         .bus_set_property = bus_service_set_property,
         .bus_commit_properties = bus_service_commit_properties,
 
index d6289a31693b2cfeb4b0680d789f1dca7e43f3b9..2442221355356a1e4f485d4485dcf93b0a25cb3f 100644 (file)
@@ -2424,7 +2424,6 @@ const UnitVTable socket_vtable = {
 
         .bus_interface = "org.freedesktop.systemd1.Socket",
         .bus_vtable = bus_socket_vtable,
-        .bus_changing_properties = bus_socket_changing_properties,
         .bus_set_property = bus_socket_set_property,
         .bus_commit_properties = bus_socket_commit_properties,
 
index b197eb469af266a11b5292b0524af497729b213e..79862e5b87183a0bc9503b2e487fe07f9b09a6ea 100644 (file)
@@ -1445,7 +1445,6 @@ const UnitVTable swap_vtable = {
 
         .bus_interface = "org.freedesktop.systemd1.Swap",
         .bus_vtable = bus_swap_vtable,
-        .bus_changing_properties = bus_swap_changing_properties,
         .bus_set_property = bus_swap_set_property,
         .bus_commit_properties = bus_swap_commit_properties,
 
index f23582c2db32e0f43d4d3b4f5a3d28665e8dcdd1..a4ff662c5ab8e778228d1afd4892a4143670f9c4 100644 (file)
@@ -646,5 +646,4 @@ const UnitVTable timer_vtable = {
 
         .bus_interface = "org.freedesktop.systemd1.Timer",
         .bus_vtable = bus_timer_vtable,
-        .bus_changing_properties = bus_timer_changing_properties,
 };
index 8ceeececc351a596a13a3c5018f682b84a6e14ff..45816eae353b94fe674c9a387f7f9c17e8c01ca6 100644 (file)
@@ -426,9 +426,6 @@ struct UnitVTable {
         /* The bus vtable */
         const sd_bus_vtable *bus_vtable;
 
-        /* strv list of changing properties */
-        const char * const * const bus_changing_properties;
-
         /* The strings to print in status messages */
         UnitStatusMessageFormats status_message_formats;