+ Manager *m = userdata;
+ Machine *machine = NULL;
+ uint32_t pid;
+ int r;
+
+ assert(bus);
+ assert(message);
+ assert(m);
+
+ r = sd_bus_message_read(message, "u", &pid);
+ if (r < 0)
+ return sd_bus_reply_method_errno(bus, message, r, NULL);
+
+ r = manager_get_machine_by_pid(m, pid, &machine);
+ if (r < 0)
+ return sd_bus_reply_method_errno(bus, message, r, NULL);
+ if (!machine)
+ return sd_bus_reply_method_errorf(bus, message, BUS_ERROR_NO_MACHINE_FOR_PID, "PID %lu does not belong to any known machine", (unsigned long) pid);
+
+ p = machine_bus_path(machine);
+ if (!p)
+ return sd_bus_reply_method_errno(bus, message, -ENOMEM, NULL);
+
+ return sd_bus_reply_method_return(bus, message, "o", p);
+}
+
+static int method_list_machines(sd_bus *bus, sd_bus_message *message, void *userdata) {
+ _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
+ Manager *m = userdata;
+ Machine *machine;
+ Iterator i;
+ int r;
+
+ assert(bus);
+ assert(message);
+ assert(m);
+
+ r = sd_bus_message_new_method_return(bus, message, &reply);
+ if (r < 0)
+ return sd_bus_reply_method_errno(bus, message, r, NULL);
+
+ r = sd_bus_message_open_container(reply, 'a', "(ssso)");
+ if (r < 0)
+ return sd_bus_reply_method_errno(bus, message, r, NULL);
+
+ HASHMAP_FOREACH(machine, m->machines, i) {
+ _cleanup_free_ char *p = NULL;
+
+ p = machine_bus_path(machine);
+ if (!p)
+ return sd_bus_reply_method_errno(bus, message, -ENOMEM, NULL);
+
+ r = sd_bus_message_append(reply, "(ssso)",
+ machine->name,
+ strempty(machine_class_to_string(machine->class)),
+ machine->service,
+ p);
+ if (r < 0)
+ return sd_bus_reply_method_errno(bus, message, r, NULL);
+ }
+
+ r = sd_bus_message_close_container(reply);
+ if (r < 0)
+ return sd_bus_reply_method_errno(bus, message, r, NULL);
+
+ return sd_bus_send(bus, reply, NULL);
+}
+
+static int method_create_machine(sd_bus *bus, sd_bus_message *message, void *userdata) {
+ _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+ const char *name, *service, *class, *root_directory;
+ Manager *manager = userdata;