]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/machine/machined.h
machined: introduce pseudo-machine ".host" refererring to the host system
[thirdparty/systemd.git] / src / machine / machined.h
CommitLineData
1ee306e1
LP
1/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3#pragma once
4
5/***
6 This file is part of systemd.
7
8 Copyright 2013 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22***/
23
24#include <stdbool.h>
1ee306e1 25
1ee306e1
LP
26#include "list.h"
27#include "hashmap.h"
c3350683
LP
28#include "sd-event.h"
29#include "sd-bus.h"
1ee306e1
LP
30
31typedef struct Manager Manager;
32
33#include "machine.h"
003dffde
LP
34#include "machine-dbus.h"
35#include "image-dbus.h"
1ee306e1
LP
36
37struct Manager {
c3350683
LP
38 sd_event *event;
39 sd_bus *bus;
1ee306e1
LP
40
41 Hashmap *machines;
42 Hashmap *machine_units;
d3e84ddb 43 Hashmap *machine_leaders;
1ee306e1 44
d04c1fb8
LP
45 Hashmap *polkit_registry;
46
1ddb263d
LP
47 Hashmap *image_cache;
48 sd_event_source *image_cache_defer_event;
49
1ee306e1 50 LIST_HEAD(Machine, machine_gc_queue);
fbe55073
LP
51
52 Machine *host_machine;
1ee306e1
LP
53};
54
1ee306e1
LP
55Manager *manager_new(void);
56void manager_free(Manager *m);
57
58int manager_add_machine(Manager *m, const char *name, Machine **_machine);
1ee306e1
LP
59int manager_enumerate_machines(Manager *m);
60
61int manager_startup(Manager *m);
62int manager_run(Manager *m);
63
64void manager_gc(Manager *m, bool drop_not_started);
65
66int manager_get_machine_by_pid(Manager *m, pid_t pid, Machine **machine);
67
c3350683
LP
68extern const sd_bus_vtable manager_vtable[];
69
19070062
LP
70int match_reloading(sd_bus_message *message, void *userdata, sd_bus_error *error);
71int match_unit_removed(sd_bus_message *message, void *userdata, sd_bus_error *error);
72int match_properties_changed(sd_bus_message *message, void *userdata, sd_bus_error *error);
73int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *error);
1ee306e1 74
c3350683
LP
75int 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);
76int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job);
de58a50e 77int manager_kill_unit(Manager *manager, const char *unit, int signo, sd_bus_error *error);
1ee306e1 78int manager_unit_is_active(Manager *manager, const char *unit);
c3350683 79int manager_job_is_active(Manager *manager, const char *path);