Lines Matching defs:machine
36 #include "machine-dbus.h"
37 #include "machine-image.h"
38 #include "machine-pool.h"
137 Machine *machine;
148 machine = hashmap_get(m->machines, name);
149 if (!machine)
150 return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name);
152 p = machine_bus_path(machine);
188 Machine *machine = NULL;
216 r = manager_get_machine_by_pid(m, pid, &machine);
219 if (!machine)
220 return sd_bus_error_setf(error, BUS_ERROR_NO_MACHINE_FOR_PID, "PID "PID_FMT" does not belong to any known machine", pid);
222 p = machine_bus_path(machine);
232 Machine *machine;
247 HASHMAP_FOREACH(machine, m->machines, i) {
250 p = machine_bus_path(machine);
255 machine->name,
256 strempty(machine_class_to_string(machine->class)),
257 machine->service,
289 return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid machine name");
299 return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid machine ID parameter");
325 return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid machine class parameter");
477 Machine *machine;
488 machine = hashmap_get(m->machines, name);
489 if (!machine)
490 return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name);
492 return bus_machine_method_terminate(message, machine, error);
497 Machine *machine;
508 machine = hashmap_get(m->machines, name);
509 if (!machine)
510 return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name);
512 return bus_machine_method_kill(message, machine, error);
517 Machine *machine;
528 machine = hashmap_get(m->machines, name);
529 if (!machine)
530 return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name);
532 return bus_machine_method_get_addresses(message, machine, error);
537 Machine *machine;
548 machine = hashmap_get(m->machines, name);
549 if (!machine)
550 return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name);
552 return bus_machine_method_get_os_release(message, machine, error);
610 Machine *machine;
621 machine = hashmap_get(m->machines, name);
622 if (!machine)
623 return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name);
625 return bus_machine_method_open_pty(message, machine, error);
630 Machine *machine;
641 machine = hashmap_get(m->machines, name);
642 if (!machine)
643 return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name);
645 return bus_machine_method_open_login(message, machine, error);
650 Machine *machine;
662 machine = hashmap_get(m->machines, name);
663 if (!machine)
664 return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name);
666 return bus_machine_method_open_shell(message, machine, error);
671 Machine *machine;
682 machine = hashmap_get(m->machines, name);
683 if (!machine)
684 return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name);
686 return bus_machine_method_bind_mount(message, machine, error);
691 Machine *machine;
702 machine = hashmap_get(m->machines, name);
703 if (!machine)
704 return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name);
706 return bus_machine_method_copy(message, machine, error);
832 /* Set up the machine directory if necessary */
885 Machine *machine;
896 machine = hashmap_get(m->machines, name);
897 if (!machine)
898 return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name);
900 if (machine->class != MACHINE_CONTAINER)
903 p = procfs_file_alloca(machine->leader, "uid_map");
938 Machine *machine;
951 HASHMAP_FOREACH(machine, m->machines, i) {
955 if (machine->class != MACHINE_CONTAINER)
958 xsprintf(p, "/proc/" UID_FMT "/uid_map", machine->leader);
988 o = machine_bus_path(machine);
992 return sd_bus_reply_method_return(message, "sou", machine->name, o, (uint32_t) converted);
1003 Machine *machine;
1014 machine = hashmap_get(m->machines, name);
1015 if (!machine)
1016 return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_MACHINE, "No machine '%s' known", name);
1018 if (machine->class != MACHINE_CONTAINER)
1021 p = procfs_file_alloca(machine->leader, "gid_map");
1056 Machine *machine;
1069 HASHMAP_FOREACH(machine, m->machines, i) {
1073 if (machine->class != MACHINE_CONTAINER)
1076 xsprintf(p, "/proc/" GID_FMT "/gid_map", machine->leader);
1106 o = machine_bus_path(machine);
1110 return sd_bus_reply_method_return(message, "sou", machine->name, o, (uint32_t) converted);
1159 Machine *machine;
1172 machine = hashmap_get(m->machine_units, unit);
1173 if (!machine)
1176 if (streq_ptr(path, machine->scope_job)) {
1177 machine->scope_job = mfree(machine->scope_job);
1179 if (machine->started) {
1181 machine_send_create_reply(machine, NULL);
1187 machine_send_create_reply(machine, &e);
1191 machine_save(machine);
1194 machine_add_to_gc_queue(machine);
1202 Machine *machine;
1220 machine = hashmap_get(m->machine_units, unit);
1221 if (!machine)
1224 machine_add_to_gc_queue(machine);
1231 Machine *machine;
1243 machine = hashmap_get(m->machine_units, unit);
1244 if (!machine)
1247 machine_add_to_gc_queue(machine);
1253 Machine *machine;
1271 HASHMAP_FOREACH(machine, m->machines, i)
1272 machine_add_to_gc_queue(machine);
1511 int manager_get_machine_by_pid(Manager *m, pid_t pid, Machine **machine) {
1517 assert(machine);
1530 *machine = mm;
1535 Machine *machine;
1540 machine = hashmap_get(m->machines, name);
1541 if (!machine) {
1542 machine = machine_new(m, _MACHINE_CLASS_INVALID, name);
1543 if (!machine)
1548 *_machine = machine;