summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-01-20 19:15:55 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-01-21 07:31:58 +0900
commit9807fdc1da8e037ddedfa4e2c6d2728b6e60051e (patch)
tree0d0f31c99faeae5b22b91beace27c455dbe911d9 /src/journal
parent4723205968d480039ee797a7661ae8cba39b21b2 (diff)
downloadsystemd-9807fdc1da8e037ddedfa4e2c6d2728b6e60051e.tar.gz
varlink: make 'userdata' pointer inheritance from varlink server to connection optional
@keszybz's right on https://github.com/systemd/systemd/pull/18248#issuecomment-760798473: swapping out the userdata pointer of a live varlink connection is iffy. Let's fix this by making the userdata inheritance from VarlinkServer object to the Varlink connection object optional: we want it for most cases, but not all, i.e. all those cases where the calls implemented as varlink methods are stateless and can be answered synchronously. For the other cases (i.e. where we want per-connection objects that wrap the asynchronous operation as it goes on) let's not do such inheritance but initialize the userdata pointer only once we have it. THis means the original manager object must be manually retrieved from the VarlinkServer object, which in turn needs to be requested from the Varlink connection object. The userdata inheritance is now controlled by the VARLINK_INHERIT_USERDATA flag passed at VarlinkServer construction. Alternative-to: #18248
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journald-server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 10ebc3e22e..5cad374083 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -2033,7 +2033,7 @@ static int server_open_varlink(Server *s, const char *socket, int fd) {
assert(s);
- r = varlink_server_new(&s->varlink_server, VARLINK_SERVER_ROOT_ONLY);
+ r = varlink_server_new(&s->varlink_server, VARLINK_SERVER_ROOT_ONLY|VARLINK_SERVER_INHERIT_USERDATA);
if (r < 0)
return r;