summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-06-27 23:21:21 +0200
committerLennart Poettering <lennart@poettering.net>2013-06-27 23:21:21 +0200
commit74c964d369b11bbf465c140c3f2dfcde2c7f5977 (patch)
tree7d4cfc98a04c2d9a0170626fd8bb3b4c40439447
parent7041efe9600e569da6089c36d00fa3ff58e33178 (diff)
dbus: hookup runtime property changes for mouns, services, sockets, swaps too
-rw-r--r--src/core/dbus-mount.c28
-rw-r--r--src/core/dbus-mount.h3
-rw-r--r--src/core/dbus-service.c28
-rw-r--r--src/core/dbus-service.h3
-rw-r--r--src/core/dbus-socket.c28
-rw-r--r--src/core/dbus-socket.h3
-rw-r--r--src/core/dbus-swap.c28
-rw-r--r--src/core/dbus-swap.h3
-rw-r--r--src/core/mount.c2
-rw-r--r--src/core/service.c2
-rw-r--r--src/core/socket.c2
-rw-r--r--src/core/swap.c2
12 files changed, 132 insertions, 0 deletions
diff --git a/src/core/dbus-mount.c b/src/core/dbus-mount.c
index 16b7afe8b7..ae04ab8c47 100644
--- a/src/core/dbus-mount.c
+++ b/src/core/dbus-mount.c
@@ -168,3 +168,31 @@ DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBusMess
return bus_default_message_handler(c, message, INTROSPECTION, INTERFACES_LIST, bps );
}
+
+int bus_mount_set_property(
+ Unit *u,
+ const char *name,
+ DBusMessageIter *i,
+ UnitSetPropertiesMode mode,
+ DBusError *error) {
+
+ Mount *m = MOUNT(u);
+ int r;
+
+ assert(name);
+ assert(u);
+ assert(i);
+
+ r = bus_cgroup_set_property(u, &m->cgroup_context, name, i, mode, error);
+ if (r != 0)
+ return r;
+
+ return 0;
+}
+
+int bus_mount_commit_properties(Unit *u) {
+ assert(u);
+
+ unit_realize_cgroup(u);
+ return 0;
+}
diff --git a/src/core/dbus-mount.h b/src/core/dbus-mount.h
index 8597394373..f4ec8b1625 100644
--- a/src/core/dbus-mount.h
+++ b/src/core/dbus-mount.h
@@ -27,5 +27,8 @@
DBusHandlerResult bus_mount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message);
+int bus_mount_set_property(Unit *u, const char *name, DBusMessageIter *i, UnitSetPropertiesMode mode, DBusError *error);
+int bus_mount_commit_properties(Unit *u);
+
extern const char bus_mount_interface[];
extern const char bus_mount_invalidating_properties[];
diff --git a/src/core/dbus-service.c b/src/core/dbus-service.c
index bbac1b8167..867ef7e54c 100644
--- a/src/core/dbus-service.c
+++ b/src/core/dbus-service.c
@@ -161,3 +161,31 @@ DBusHandlerResult bus_service_message_handler(Unit *u, DBusConnection *connectio
return bus_default_message_handler(connection, message, INTROSPECTION, INTERFACES_LIST, bps);
}
+
+int bus_service_set_property(
+ Unit *u,
+ const char *name,
+ DBusMessageIter *i,
+ UnitSetPropertiesMode mode,
+ DBusError *error) {
+
+ Service *s = SERVICE(u);
+ int r;
+
+ assert(name);
+ assert(u);
+ assert(i);
+
+ r = bus_cgroup_set_property(u, &s->cgroup_context, name, i, mode, error);
+ if (r != 0)
+ return r;
+
+ return 0;
+}
+
+int bus_service_commit_properties(Unit *u) {
+ assert(u);
+
+ unit_realize_cgroup(u);
+ return 0;
+}
diff --git a/src/core/dbus-service.h b/src/core/dbus-service.h
index 143aed7ae5..9b9f13701c 100644
--- a/src/core/dbus-service.h
+++ b/src/core/dbus-service.h
@@ -27,5 +27,8 @@
DBusHandlerResult bus_service_message_handler(Unit *u, DBusConnection *c, DBusMessage *message);
+int bus_service_set_property(Unit *u, const char *name, DBusMessageIter *i, UnitSetPropertiesMode mode, DBusError *error);
+int bus_service_commit_properties(Unit *u);
+
extern const char bus_service_interface[];
extern const char bus_service_invalidating_properties[];
diff --git a/src/core/dbus-socket.c b/src/core/dbus-socket.c
index 7ec4f33924..7ef55ec711 100644
--- a/src/core/dbus-socket.c
+++ b/src/core/dbus-socket.c
@@ -213,3 +213,31 @@ DBusHandlerResult bus_socket_message_handler(Unit *u, DBusConnection *c, DBusMes
return bus_default_message_handler(c, message, INTROSPECTION, INTERFACES_LIST, bps);
}
+
+int bus_socket_set_property(
+ Unit *u,
+ const char *name,
+ DBusMessageIter *i,
+ UnitSetPropertiesMode mode,
+ DBusError *error) {
+
+ Socket *s = SOCKET(u);
+ int r;
+
+ assert(name);
+ assert(u);
+ assert(i);
+
+ r = bus_cgroup_set_property(u, &s->cgroup_context, name, i, mode, error);
+ if (r != 0)
+ return r;
+
+ return 0;
+}
+
+int bus_socket_commit_properties(Unit *u) {
+ assert(u);
+
+ unit_realize_cgroup(u);
+ return 0;
+}
diff --git a/src/core/dbus-socket.h b/src/core/dbus-socket.h
index 5369b22e5e..eb035c1a94 100644
--- a/src/core/dbus-socket.h
+++ b/src/core/dbus-socket.h
@@ -27,5 +27,8 @@
DBusHandlerResult bus_socket_message_handler(Unit *u, DBusConnection *c, DBusMessage *message);
+int bus_socket_set_property(Unit *u, const char *name, DBusMessageIter *i, UnitSetPropertiesMode mode, DBusError *error);
+int bus_socket_commit_properties(Unit *u);
+
extern const char bus_socket_interface[];
extern const char bus_socket_invalidating_properties[];
diff --git a/src/core/dbus-swap.c b/src/core/dbus-swap.c
index 4ae1cd08e0..0248b4b391 100644
--- a/src/core/dbus-swap.c
+++ b/src/core/dbus-swap.c
@@ -115,3 +115,31 @@ DBusHandlerResult bus_swap_message_handler(Unit *u, DBusConnection *c, DBusMessa
return bus_default_message_handler(c, message, INTROSPECTION, INTERFACES_LIST, bps);
}
+
+int bus_swap_set_property(
+ Unit *u,
+ const char *name,
+ DBusMessageIter *i,
+ UnitSetPropertiesMode mode,
+ DBusError *error) {
+
+ Swap *s = SWAP(u);
+ int r;
+
+ assert(name);
+ assert(u);
+ assert(i);
+
+ r = bus_cgroup_set_property(u, &s->cgroup_context, name, i, mode, error);
+ if (r != 0)
+ return r;
+
+ return 0;
+}
+
+int bus_swap_commit_properties(Unit *u) {
+ assert(u);
+
+ unit_realize_cgroup(u);
+ return 0;
+}
diff --git a/src/core/dbus-swap.h b/src/core/dbus-swap.h
index 41fe4447ff..9b586a1ad2 100644
--- a/src/core/dbus-swap.h
+++ b/src/core/dbus-swap.h
@@ -28,5 +28,8 @@
DBusHandlerResult bus_swap_message_handler(Unit *u, DBusConnection *c, DBusMessage *message);
+int bus_swap_set_property(Unit *u, const char *name, DBusMessageIter *i, UnitSetPropertiesMode mode, DBusError *error);
+int bus_swap_commit_properties(Unit *u);
+
extern const char bus_swap_interface[];
extern const char bus_swap_invalidating_properties[];
diff --git a/src/core/mount.c b/src/core/mount.c
index c71d51bfa4..c1af903b12 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1916,6 +1916,8 @@ const UnitVTable mount_vtable = {
.bus_interface = "org.freedesktop.systemd1.Mount",
.bus_message_handler = bus_mount_message_handler,
.bus_invalidating_properties = bus_mount_invalidating_properties,
+ .bus_set_property = bus_mount_set_property,
+ .bus_commit_properties = bus_mount_commit_properties,
.enumerate = mount_enumerate,
.shutdown = mount_shutdown,
diff --git a/src/core/service.c b/src/core/service.c
index 5fdbdb13a3..1dcd5cf443 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -3883,6 +3883,8 @@ const UnitVTable service_vtable = {
.bus_interface = "org.freedesktop.systemd1.Service",
.bus_message_handler = bus_service_message_handler,
.bus_invalidating_properties = bus_service_invalidating_properties,
+ .bus_set_property = bus_service_set_property,
+ .bus_commit_properties = bus_service_commit_properties,
#ifdef HAVE_SYSV_COMPAT
.enumerate = service_enumerate,
diff --git a/src/core/socket.c b/src/core/socket.c
index c1bbaec447..2def0c9ead 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -2396,6 +2396,8 @@ const UnitVTable socket_vtable = {
.bus_interface = "org.freedesktop.systemd1.Socket",
.bus_message_handler = bus_socket_message_handler,
.bus_invalidating_properties = bus_socket_invalidating_properties,
+ .bus_set_property = bus_socket_set_property,
+ .bus_commit_properties = bus_socket_commit_properties,
.status_message_formats = {
/*.starting_stopping = {
diff --git a/src/core/swap.c b/src/core/swap.c
index 0d4b4fa4f9..825503f3de 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -1363,6 +1363,8 @@ const UnitVTable swap_vtable = {
.bus_interface = "org.freedesktop.systemd1.Swap",
.bus_message_handler = bus_swap_message_handler,
.bus_invalidating_properties = bus_swap_invalidating_properties,
+ .bus_set_property = bus_swap_set_property,
+ .bus_commit_properties = bus_swap_commit_properties,
.following = swap_following,
.following_set = swap_following_set,