]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/machine/machined.h
Merge pull request #8741 from poettering/assorted-stuff2
[thirdparty/systemd.git] / src / machine / machined.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 This file is part of systemd.
6
7 Copyright 2013 Lennart Poettering
8 ***/
9
10 #include <stdbool.h>
11
12 #include "sd-bus.h"
13 #include "sd-event.h"
14
15 #include "hashmap.h"
16 #include "list.h"
17
18 typedef struct Manager Manager;
19
20 #include "image-dbus.h"
21 #include "machine-dbus.h"
22 #include "machine.h"
23 #include "operation.h"
24
25 struct Manager {
26 sd_event *event;
27 sd_bus *bus;
28
29 Hashmap *machines;
30 Hashmap *machine_units;
31 Hashmap *machine_leaders;
32
33 Hashmap *polkit_registry;
34
35 Hashmap *image_cache;
36 sd_event_source *image_cache_defer_event;
37
38 LIST_HEAD(Machine, machine_gc_queue);
39
40 Machine *host_machine;
41
42 LIST_HEAD(Operation, operations);
43 unsigned n_operations;
44 };
45
46 int manager_add_machine(Manager *m, const char *name, Machine **_machine);
47 int manager_get_machine_by_pid(Manager *m, pid_t pid, Machine **machine);
48
49 extern const sd_bus_vtable manager_vtable[];
50
51 int match_reloading(sd_bus_message *message, void *userdata, sd_bus_error *error);
52 int match_unit_removed(sd_bus_message *message, void *userdata, sd_bus_error *error);
53 int match_properties_changed(sd_bus_message *message, void *userdata, sd_bus_error *error);
54 int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *error);
55
56 int manager_start_scope(Manager *manager, const char *scope, pid_t pid, const char *slice, const char *description, sd_bus_message *more_properties, sd_bus_error *error, char **job);
57 int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job);
58 int manager_kill_unit(Manager *manager, const char *unit, int signo, sd_bus_error *error);
59 int manager_unit_is_active(Manager *manager, const char *unit);
60 int manager_job_is_active(Manager *manager, const char *path);