#include <errno.h>
#include <string.h>
-#include "logind.h"
-#include "logind-machine.h"
+#include "machined.h"
+#include "machine.h"
#include "dbus-common.h"
#define BUS_MACHINE_INTERFACE \
- " <interface name=\"org.freedesktop.login1.Machine\">\n" \
+ " <interface name=\"org.freedesktop.machine1.Machine\">\n" \
" <method name=\"Terminate\"/>\n" \
" <method name=\"Kill\">\n" \
" <arg name=\"who\" type=\"s\"/>\n" \
#define INTERFACES_LIST \
BUS_GENERIC_INTERFACES_LIST \
- "org.freedesktop.login1.Machine\0"
+ "org.freedesktop.machine1.Machine\0"
static int bus_machine_append_id(DBusMessageIter *i, const char *property, void *data) {
DBusMessageIter sub;
assert(path);
assert(_machine);
- if (!startswith(path, "/org/freedesktop/login1/machine/"))
+ if (!startswith(path, "/org/freedesktop/machine1/machine/"))
return -EINVAL;
e = bus_path_unescape(path + 32);
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_machine_append_class, machine_class, MachineClass);
-static const BusProperty bus_login_machine_properties[] = {
+static const BusProperty bus_machine_machine_properties[] = {
{ "Name", bus_property_append_string, "s", offsetof(Machine, name), true },
{ "Id", bus_machine_append_id, "ay", 0 },
{ "Timestamp", bus_property_append_usec, "t", offsetof(Machine, timestamp.realtime) },
{ "TimestampMonotonic", bus_property_append_usec, "t", offsetof(Machine, timestamp.monotonic) },
{ "Service", bus_property_append_string, "s", offsetof(Machine, service), true },
{ "Scope", bus_property_append_string, "s", offsetof(Machine, scope), true },
- { "Leader", bus_property_append_pid, "u", offsetof(Session, leader) },
{ "Class", bus_machine_append_class, "s", offsetof(Machine, class) },
{ "State", bus_machine_append_state, "s", 0 },
{ "RootDirectory", bus_property_append_string, "s", offsetof(Machine, root_directory), true },
assert(connection);
assert(message);
- if (dbus_message_is_method_call(message, "org.freedesktop.login1.Machine", "Terminate")) {
+ if (dbus_message_is_method_call(message, "org.freedesktop.machine1.Machine", "Terminate")) {
r = machine_stop(m);
if (r < 0)
if (!reply)
goto oom;
- } else if (dbus_message_is_method_call(message, "org.freedesktop.login1.Machine", "Kill")) {
+ } else if (dbus_message_is_method_call(message, "org.freedesktop.machine1.Machine", "Kill")) {
const char *swho;
int32_t signo;
KillWho who;
} else {
const BusBoundProperties bps[] = {
- { "org.freedesktop.login1.Machine", bus_login_machine_properties, m },
+ { "org.freedesktop.machine1.Machine", bus_machine_machine_properties, m },
{ NULL, }
};
if (!e)
return NULL;
- return strappend("/org/freedesktop/login1/machine/", e);
+ return strappend("/org/freedesktop/machine1/machine/", e);
}
int machine_send_signal(Machine *m, bool new_machine) {
assert(m);
- msg = dbus_message_new_signal("/org/freedesktop/login1",
- "org.freedesktop.login1.Manager",
+ msg = dbus_message_new_signal("/org/freedesktop/machine1",
+ "org.freedesktop.machine1.Manager",
new_machine ? "MachineNew" : "MachineRemoved");
if (!m)
if (!p)
return -ENOMEM;
- msg = bus_properties_changed_new(p, "org.freedesktop.login1.Machine", properties);
+ msg = bus_properties_changed_new(p, "org.freedesktop.machine1.Machine", properties);
if (!msg)
return -ENOMEM;