]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/machine/machine.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright 2013 Lennart Poettering
10 typedef struct Machine Machine
;
11 typedef enum KillWho KillWho
;
15 #include "operation.h"
17 typedef enum MachineState
{
18 MACHINE_OPENING
, /* Machine is being registered */
19 MACHINE_RUNNING
, /* Machine is running */
20 MACHINE_CLOSING
, /* Machine is terminating */
22 _MACHINE_STATE_INVALID
= -1
25 typedef enum MachineClass
{
30 _MACHINE_CLASS_INVALID
= -1
37 _KILL_WHO_INVALID
= -1
57 dual_timestamp timestamp
;
63 sd_bus_message
*create_message
;
68 LIST_HEAD(Operation
, operations
);
70 LIST_FIELDS(Machine
, gc_queue
);
73 Machine
* machine_new(Manager
*manager
, MachineClass
class, const char *name
);
74 void machine_free(Machine
*m
);
75 bool machine_may_gc(Machine
*m
, bool drop_not_started
);
76 void machine_add_to_gc_queue(Machine
*m
);
77 int machine_start(Machine
*m
, sd_bus_message
*properties
, sd_bus_error
*error
);
78 int machine_stop(Machine
*m
);
79 int machine_finalize(Machine
*m
);
80 int machine_save(Machine
*m
);
81 int machine_load(Machine
*m
);
82 int machine_kill(Machine
*m
, KillWho who
, int signo
);
84 void machine_release_unit(Machine
*m
);
86 MachineState
machine_get_state(Machine
*u
);
88 const char* machine_class_to_string(MachineClass t
) _const_
;
89 MachineClass
machine_class_from_string(const char *s
) _pure_
;
91 const char* machine_state_to_string(MachineState t
) _const_
;
92 MachineState
machine_state_from_string(const char *s
) _pure_
;
94 const char *kill_who_to_string(KillWho k
) _const_
;
95 KillWho
kill_who_from_string(const char *s
) _pure_
;
97 int machine_openpt(Machine
*m
, int flags
);
98 int machine_open_terminal(Machine
*m
, const char *path
, int mode
);
100 int machine_get_uid_shift(Machine
*m
, uid_t
*ret
);