diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-04-29 20:32:56 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-05-02 11:17:06 +0200 |
commit | 795c5d31affeb3b3edbf673940cc0f16afebc7a8 (patch) | |
tree | ffd79868bad763f8bfa094f7a4b6c0e824333bb5 /src/machine/machine.h | |
parent | 5d2036b5f3506bd0ff07042aee8d69c26db32298 (diff) |
machined: rework copy-from/copy-to operation to use generic Operation object
With this all potentially slow operations are done out-of-process,
asynchronously, using the same "Operation" object.
Diffstat (limited to 'src/machine/machine.h')
-rw-r--r-- | src/machine/machine.h | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/machine/machine.h b/src/machine/machine.h index 1d8cc5911a..e5d75361a9 100644 --- a/src/machine/machine.h +++ b/src/machine/machine.h @@ -20,11 +20,11 @@ ***/ typedef struct Machine Machine; -typedef struct MachineOperation MachineOperation; typedef enum KillWho KillWho; #include "list.h" #include "machined.h" +#include "operation.h" typedef enum MachineState { MACHINE_OPENING, /* Machine is being registered */ @@ -49,17 +49,6 @@ 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; @@ -88,10 +77,9 @@ struct Machine { int *netif; unsigned n_netif; - LIST_FIELDS(Machine, gc_queue); + LIST_HEAD(Operation, operations); - MachineOperation *operations; - unsigned n_operations; + LIST_FIELDS(Machine, gc_queue); }; Machine* machine_new(Manager *manager, MachineClass class, const char *name); @@ -109,8 +97,6 @@ void machine_release_unit(Machine *m); 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_; |