***/
typedef struct Machine Machine;
+typedef struct MachineOperation MachineOperation;
typedef enum KillWho KillWho;
#include "list.h"
-#include "util.h"
#include "machined.h"
typedef enum MachineState {
_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;
char *service;
char *root_directory;
- char *scope;
+ char *unit;
char *scope_job;
pid_t leader;
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);
void machine_free(Machine *m);
-int machine_check_gc(Machine *m, bool drop_not_started);
+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);
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_;