]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/machine/machined.h
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / machine / machined.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
1ee306e1
LP
2#pragma once
3
1ee306e1 4#include <stdbool.h>
1ee306e1 5
c3350683 6#include "sd-bus.h"
07630cea
LP
7#include "sd-event.h"
8
9#include "hashmap.h"
10#include "list.h"
1ee306e1
LP
11
12typedef struct Manager Manager;
13
003dffde 14#include "image-dbus.h"
71d35b6b
TA
15#include "machine-dbus.h"
16#include "machine.h"
56599585 17#include "operation.h"
1ee306e1
LP
18
19struct Manager {
c3350683
LP
20 sd_event *event;
21 sd_bus *bus;
1ee306e1
LP
22
23 Hashmap *machines;
24 Hashmap *machine_units;
d3e84ddb 25 Hashmap *machine_leaders;
1ee306e1 26
d04c1fb8
LP
27 Hashmap *polkit_registry;
28
1ddb263d
LP
29 Hashmap *image_cache;
30 sd_event_source *image_cache_defer_event;
31
1ee306e1 32 LIST_HEAD(Machine, machine_gc_queue);
fbe55073
LP
33
34 Machine *host_machine;
56599585
LP
35
36 LIST_HEAD(Operation, operations);
37 unsigned n_operations;
9fdcbae5
LP
38
39 sd_event_source *nscd_cache_flush_event;
1ee306e1
LP
40};
41
1ee306e1 42int manager_add_machine(Manager *m, const char *name, Machine **_machine);
1ee306e1
LP
43int manager_get_machine_by_pid(Manager *m, pid_t pid, Machine **machine);
44
c3350683
LP
45extern const sd_bus_vtable manager_vtable[];
46
19070062
LP
47int match_reloading(sd_bus_message *message, void *userdata, sd_bus_error *error);
48int match_unit_removed(sd_bus_message *message, void *userdata, sd_bus_error *error);
49int match_properties_changed(sd_bus_message *message, void *userdata, sd_bus_error *error);
50int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *error);
1ee306e1 51
c3350683
LP
52int 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);
53int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job);
de58a50e 54int manager_kill_unit(Manager *manager, const char *unit, int signo, sd_bus_error *error);
b92d0b4c 55int manager_unref_unit(Manager *m, const char *unit, sd_bus_error *error);
1ee306e1 56int manager_unit_is_active(Manager *manager, const char *unit);
c3350683 57int manager_job_is_active(Manager *manager, const char *path);
9fdcbae5
LP
58
59int manager_enqueue_nscd_cache_flush(Manager *m);