chiark / gitweb /
machined: make "machinectl copy-to" and "machinectl copy-from" server side operations
[elogind.git] / src / machine / machine.h
index 4827ba332fa870ab22b2c09665d66fc84c42d171..94dbac016064fa4bc5f69d3eb3f3cbd7fd5c2ab2 100644 (file)
@@ -22,6 +22,7 @@
 ***/
 
 typedef struct Machine Machine;
+typedef struct MachineOperation MachineOperation;
 typedef enum KillWho KillWho;
 
 #include "list.h"
@@ -50,6 +51,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;
 
@@ -79,6 +91,9 @@ struct Machine {
         unsigned n_netif;
 
         LIST_FIELDS(Machine, gc_queue);
+
+        MachineOperation *operations;
+        unsigned n_operations;
 };
 
 Machine* machine_new(Manager *manager, const char *name);
@@ -93,6 +108,8 @@ int machine_kill(Machine *m, KillWho who, int signo);
 
 MachineState machine_get_state(Machine *u);
 
+MachineOperation *machine_operation_unref(MachineOperation *o);
+
 const char* machine_class_to_string(MachineClass t) _const_;
 MachineClass machine_class_from_string(const char *s) _pure_;