summaryrefslogtreecommitdiffstats
path: root/src/machine/machined-varlink.c
diff options
context:
space:
mode:
authorIvan Kruglov <mail@ikruglov.com>2024-10-07 11:27:16 +0200
committerIvan Kruglov <mail@ikruglov.com>2024-10-07 14:45:49 +0200
commit6bb6354b4fe85090fdfb2b2d8c92f6e2da6b6550 (patch)
tree9a750346131dab37a03db5cb600ac75dacff0f2f /src/machine/machined-varlink.c
parentmachine: introduce io.systemd.Machine.Unregister varlink method (diff)
downloadsystemd-6bb6354b4fe85090fdfb2b2d8c92f6e2da6b6550.tar.xz
systemd-6bb6354b4fe85090fdfb2b2d8c92f6e2da6b6550.zip
machine: introduce io.systemd.Machine.Terminate varlink method
Diffstat (limited to 'src/machine/machined-varlink.c')
-rw-r--r--src/machine/machined-varlink.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/machine/machined-varlink.c b/src/machine/machined-varlink.c
index 94d8c16799..fbf03ad4a1 100644
--- a/src/machine/machined-varlink.c
+++ b/src/machine/machined-varlink.c
@@ -502,6 +502,10 @@ static int vl_method_unregister(sd_varlink *link, sd_json_variant *parameters, s
return lookup_machine_and_call_method(link, parameters, flags, userdata, vl_method_unregister_internal);
}
+static int vl_method_terminate(sd_varlink *link, sd_json_variant *parameters, sd_varlink_method_flags_t flags, void *userdata) {
+ return lookup_machine_and_call_method(link, parameters, flags, userdata, vl_method_terminate_internal);
+}
+
static int manager_varlink_init_userdb(Manager *m) {
_cleanup_(sd_varlink_server_unrefp) sd_varlink_server *s = NULL;
int r;
@@ -566,7 +570,8 @@ static int manager_varlink_init_machine(Manager *m) {
s,
"io.systemd.Machine.Register", vl_method_register,
"io.systemd.Machine.List", vl_method_list,
- "io.systemd.Machine.Unregister", vl_method_unregister);
+ "io.systemd.Machine.Unregister", vl_method_unregister,
+ "io.systemd.Machine.Terminate", vl_method_terminate);
if (r < 0)
return log_error_errno(r, "Failed to register varlink methods: %m");