summaryrefslogtreecommitdiffstats
path: root/src/machine/machinectl.c
diff options
context:
space:
mode:
authorQuentin Deslandes <qdeslandes@fb.com>2022-07-05 11:41:45 +0200
committerLennart Poettering <lennart@poettering.net>2022-07-05 16:40:16 +0200
commit57f28dee00effd7164bc89fa33bf16dc23fcc693 (patch)
tree660eed610e0bc0c081b952220226840f373babf7 /src/machine/machinectl.c
parentuser: delegate cpu controller, assign weights to user slices (diff)
downloadsystemd-57f28dee00effd7164bc89fa33bf16dc23fcc693.tar.xz
systemd-57f28dee00effd7164bc89fa33bf16dc23fcc693.zip
machine: switch to BusLocator-oriented helpers
Replace existing sd_bus_x calls with counterparts from bus-locator.h.
Diffstat (limited to 'src/machine/machinectl.c')
-rw-r--r--src/machine/machinectl.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 34d1d9dd8e..213879c8ed 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -1586,11 +1586,9 @@ static int start_machine(int argc, char *argv[], void *userdata) {
"Machine image '%s' does not exist.",
argv[i]);
- r = sd_bus_call_method(
+ r = bus_call_method(
bus,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager",
+ bus_systemd_mgr,
"StartUnit",
&error,
&reply,
@@ -1629,13 +1627,7 @@ static int enable_machine(int argc, char *argv[], void *userdata) {
method = streq(argv[0], "enable") ? "EnableUnitFiles" : "DisableUnitFiles";
- r = sd_bus_message_new_method_call(
- bus,
- &m,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager",
- method);
+ r = bus_message_new_method_call(bus, &m, bus_systemd_mgr, method);
if (r < 0)
return bus_log_create_error(r);
@@ -1688,15 +1680,7 @@ static int enable_machine(int argc, char *argv[], void *userdata) {
if (r < 0)
goto finish;
- r = sd_bus_call_method(
- bus,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager",
- "Reload",
- &error,
- NULL,
- NULL);
+ r = bus_call_method(bus, bus_systemd_mgr, "Reload", &error, NULL, NULL);
if (r < 0) {
log_error("Failed to reload daemon: %s", bus_error_message(&error, r));
goto finish;