summaryrefslogtreecommitdiffstats
path: root/src/machine/operation.h
diff options
context:
space:
mode:
authorIvan Kruglov <mail@ikruglov.com>2024-10-11 16:26:38 +0200
committerLennart Poettering <lennart@poettering.net>2024-10-21 17:08:14 +0200
commitd8964f9d4d7947d5fa9367f95a4e1f3c223beecf (patch)
tree289d196935c1a169407cdffe98876bde58048169 /src/machine/operation.h
parentMerge pull request #34403 from poettering/askpw-per-user (diff)
downloadsystemd-d8964f9d4d7947d5fa9367f95a4e1f3c223beecf.tar.xz
systemd-d8964f9d4d7947d5fa9367f95a4e1f3c223beecf.zip
machine: rework Operation logic to reuse in varlink interface
Diffstat (limited to '')
-rw-r--r--src/machine/operation.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/machine/operation.h b/src/machine/operation.h
index fd4828878d..75bf918c2b 100644
--- a/src/machine/operation.h
+++ b/src/machine/operation.h
@@ -18,7 +18,11 @@ struct Operation {
Manager *manager;
Machine *machine;
pid_t pid;
+
+ /* only one of these two fields should be set */
+ sd_varlink *link;
sd_bus_message *message;
+
int errno_fd;
int extra_fd;
sd_event_source *event_source;
@@ -27,5 +31,11 @@ struct Operation {
LIST_FIELDS(Operation, operations_by_machine);
};
-int operation_new(Manager *manager, Machine *machine, pid_t child, sd_bus_message *message, int errno_fd, Operation **ret);
+int operation_new(Manager *manager, Machine *machine, pid_t child, sd_bus_message *message, sd_varlink *link, int errno_fd, Operation **ret);
Operation *operation_free(Operation *o);
+static inline int operation_new_with_bus_reply(Manager *manager, Machine *machine, pid_t child, sd_bus_message *message, int errno_fd, Operation **ret) {
+ return operation_new(manager, machine, child, message, /* link = */ NULL, errno_fd, ret);
+}
+static inline int operation_new_with_varlink_reply(Manager *manager, Machine *machine, pid_t child, sd_varlink *link, int errno_fd, Operation **ret) {
+ return operation_new(manager, machine, child, /* message = */ NULL, link, errno_fd, ret);
+}