]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/machine/machine.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / machine / machine.h
index 4827ba332fa870ab22b2c09665d66fc84c42d171..1ee82ffe814452c919de4c2455e0bfb9993fce77 100644 (file)
@@ -1,5 +1,4 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
@@ -25,8 +24,8 @@ typedef struct Machine Machine;
 typedef enum KillWho KillWho;
 
 #include "list.h"
-#include "util.h"
 #include "machined.h"
+#include "operation.h"
 
 typedef enum MachineState {
         MACHINE_OPENING,    /* Machine is being registered */
@@ -39,6 +38,7 @@ typedef enum MachineState {
 typedef enum MachineClass {
         MACHINE_CONTAINER,
         MACHINE_VM,
+        MACHINE_HOST,
         _MACHINE_CLASS_MAX,
         _MACHINE_CLASS_INVALID = -1
 } MachineClass;
@@ -56,7 +56,6 @@ struct Machine {
         char *name;
         sd_id128_t id;
 
-        MachineState state;
         MachineClass class;
 
         char *state_file;
@@ -72,25 +71,31 @@ struct Machine {
 
         bool in_gc_queue:1;
         bool started:1;
+        bool stopping:1;
 
         sd_bus_message *create_message;
 
         int *netif;
         unsigned n_netif;
 
+        LIST_HEAD(Operation, operations);
+
         LIST_FIELDS(Machine, gc_queue);
 };
 
-Machine* machine_new(Manager *manager, const char *name);
+Machine* machine_new(Manager *manager, MachineClass class, const char *name);
 void machine_free(Machine *m);
 bool machine_check_gc(Machine *m, bool drop_not_started);
 void machine_add_to_gc_queue(Machine *m);
 int machine_start(Machine *m, sd_bus_message *properties, sd_bus_error *error);
 int machine_stop(Machine *m);
+int machine_finalize(Machine *m);
 int machine_save(Machine *m);
 int machine_load(Machine *m);
 int machine_kill(Machine *m, KillWho who, int signo);
 
+void machine_release_unit(Machine *m);
+
 MachineState machine_get_state(Machine *u);
 
 const char* machine_class_to_string(MachineClass t) _const_;
@@ -101,3 +106,8 @@ MachineState machine_state_from_string(const char *s) _pure_;
 
 const char *kill_who_to_string(KillWho k) _const_;
 KillWho kill_who_from_string(const char *s) _pure_;
+
+int machine_openpt(Machine *m, int flags);
+int machine_open_terminal(Machine *m, const char *path, int mode);
+
+int machine_get_uid_shift(Machine *m, uid_t *ret);