From 6bb6354b4fe85090fdfb2b2d8c92f6e2da6b6550 Mon Sep 17 00:00:00 2001 From: Ivan Kruglov Date: Mon, 7 Oct 2024 11:27:16 +0200 Subject: machine: introduce io.systemd.Machine.Terminate varlink method --- src/machine/machined-varlink.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/machine/machined-varlink.c') 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"); -- cgit v1.2.3