-#include "virt.h"
-
-#define BUS_MANAGER_INTERFACE \
- " <interface name=\"org.freedesktop.machine1.Manager\">\n" \
- " <method name=\"GetMachine\">\n" \
- " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
- " <arg name=\"machine\" type=\"o\" direction=\"out\"/>\n" \
- " </method>\n" \
- " <method name=\"GetMachineByPID\">\n" \
- " <arg name=\"pid\" type=\"u\" direction=\"in\"/>\n" \
- " <arg name=\"machine\" type=\"o\" direction=\"out\"/>\n" \
- " </method>\n" \
- " <method name=\"ListMachines\">\n" \
- " <arg name=\"machines\" type=\"a(ssso)\" direction=\"out\"/>\n" \
- " </method>\n" \
- " <method name=\"CreateMachine\">\n" \
- " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
- " <arg name=\"id\" type=\"ay\" direction=\"in\"/>\n" \
- " <arg name=\"service\" type=\"s\" direction=\"in\"/>\n" \
- " <arg name=\"class\" type=\"s\" direction=\"in\"/>\n" \
- " <arg name=\"leader\" type=\"u\" direction=\"in\"/>\n" \
- " <arg name=\"root_directory\" type=\"s\" direction=\"in\"/>\n" \
- " <arg name=\"scope_properties\" type=\"a(sv)\" direction=\"in\"/>\n" \
- " <arg name=\"path\" type=\"o\" direction=\"out\"/>\n" \
- " </method>\n" \
- " <method name=\"KillMachine\">\n" \
- " <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
- " <arg name=\"who\" type=\"s\" direction=\"in\"/>\n" \
- " <arg name=\"signal\" type=\"s\" direction=\"in\"/>\n" \
- " </method>\n" \
- " <method name=\"TerminateMachine\">\n" \
- " <arg name=\"id\" type=\"s\" direction=\"in\"/>\n" \
- " </method>\n" \
- " <signal name=\"MachineNew\">\n" \
- " <arg name=\"machine\" type=\"s\"/>\n" \
- " <arg name=\"path\" type=\"o\"/>\n" \
- " </signal>\n" \
- " <signal name=\"MachineRemoved\">\n" \
- " <arg name=\"machine\" type=\"s\"/>\n" \
- " <arg name=\"path\" type=\"o\"/>\n" \
- " </signal>\n" \
- " </interface>\n"
-
-#define INTROSPECTION_BEGIN \
- DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
- "<node>\n" \
- BUS_MANAGER_INTERFACE \
- BUS_PROPERTIES_INTERFACE \
- BUS_PEER_INTERFACE \
- BUS_INTROSPECTABLE_INTERFACE
-
-#define INTROSPECTION_END \
- "</node>\n"
-
-#define INTERFACES_LIST \
- BUS_GENERIC_INTERFACES_LIST \
- "org.freedesktop.machine1.Manager\0"
-
-static bool valid_machine_name(const char *p) {
- size_t l;
-
- if (!filename_is_safe(p))
- return false;
-
- if (!ascii_is_valid(p))
- return false;
-
- l = strlen(p);
-
- if (l < 1 || l> 64)
- return false;