chiark / gitweb /
machined: also set up /var/lib/machines as btrfs, if "machinectl set-limit" is called
[elogind.git] / src / machine / machine.h
index 99ee25888e70aab82133696ca518fff6430de325..7b27aa27e0ec53e2e880be2f4146eef56349642b 100644 (file)
 ***/
 
 typedef struct Machine Machine;
+typedef struct MachineOperation MachineOperation;
 typedef enum KillWho KillWho;
 
 #include "list.h"
-#include "util.h"
 #include "machined.h"
 
 typedef enum MachineState {
@@ -50,6 +50,17 @@ enum KillWho {
         _KILL_WHO_INVALID = -1
 };
 
+#define MACHINE_OPERATIONS_MAX 64
+
+struct MachineOperation {
+        Machine *machine;
+        pid_t pid;
+        sd_bus_message *message;
+        int errno_fd;
+        sd_event_source *event_source;
+        LIST_FIELDS(MachineOperation, operations);
+};
+
 struct Machine {
         Manager *manager;
 
@@ -63,7 +74,7 @@ struct Machine {
         char *service;
         char *root_directory;
 
-        char *scope;
+        char *unit;
         char *scope_job;
 
         pid_t leader;
@@ -75,7 +86,13 @@ struct Machine {
 
         sd_bus_message *create_message;
 
+        int *netif;
+        unsigned n_netif;
+
         LIST_FIELDS(Machine, gc_queue);
+
+        MachineOperation *operations;
+        unsigned n_operations;
 };
 
 Machine* machine_new(Manager *manager, const char *name);
@@ -90,13 +107,7 @@ int machine_kill(Machine *m, KillWho who, int signo);
 
 MachineState machine_get_state(Machine *u);
 
-extern const sd_bus_vtable machine_vtable[];
-
-char *machine_bus_path(Machine *s);
-int machine_object_find(sd_bus *bus, const char *path, const char *interface, void **found, void *userdata);
-
-int machine_send_signal(Machine *m, bool new_machine);
-int machine_send_create_reply(Machine *m, sd_bus_error *error);
+MachineOperation *machine_operation_unref(MachineOperation *o);
 
 const char* machine_class_to_string(MachineClass t) _const_;
 MachineClass machine_class_from_string(const char *s) _pure_;