]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/machine/machine.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
4 typedef struct Machine Machine
;
5 typedef enum KillWho KillWho
;
11 typedef enum MachineState
{
12 MACHINE_OPENING
, /* Machine is being registered */
13 MACHINE_RUNNING
, /* Machine is running */
14 MACHINE_CLOSING
, /* Machine is terminating */
16 _MACHINE_STATE_INVALID
= -1
19 typedef enum MachineClass
{
24 _MACHINE_CLASS_INVALID
= -1
31 _KILL_WHO_INVALID
= -1
51 dual_timestamp timestamp
;
57 sd_bus_message
*create_message
;
62 LIST_HEAD(Operation
, operations
);
64 LIST_FIELDS(Machine
, gc_queue
);
67 Machine
* machine_new(Manager
*manager
, MachineClass
class, const char *name
);
68 Machine
* machine_free(Machine
*m
);
69 bool machine_may_gc(Machine
*m
, bool drop_not_started
);
70 void machine_add_to_gc_queue(Machine
*m
);
71 int machine_start(Machine
*m
, sd_bus_message
*properties
, sd_bus_error
*error
);
72 int machine_stop(Machine
*m
);
73 int machine_finalize(Machine
*m
);
74 int machine_save(Machine
*m
);
75 int machine_load(Machine
*m
);
76 int machine_kill(Machine
*m
, KillWho who
, int signo
);
78 void machine_release_unit(Machine
*m
);
80 MachineState
machine_get_state(Machine
*u
);
82 const char* machine_class_to_string(MachineClass t
) _const_
;
83 MachineClass
machine_class_from_string(const char *s
) _pure_
;
85 const char* machine_state_to_string(MachineState t
) _const_
;
86 MachineState
machine_state_from_string(const char *s
) _pure_
;
88 const char *kill_who_to_string(KillWho k
) _const_
;
89 KillWho
kill_who_from_string(const char *s
) _pure_
;
91 int machine_openpt(Machine
*m
, int flags
);
92 int machine_open_terminal(Machine
*m
, const char *path
, int mode
);
94 int machine_get_uid_shift(Machine
*m
, uid_t
*ret
);