]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/machine/operation.h
2144d9fba2db4fd7f0a1adaa05e6b1e2702ce522
[thirdparty/systemd.git] / src / machine / operation.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 Copyright 2016 Lennart Poettering
6 ***/
7
8 #include <sys/types.h>
9
10 #include "sd-bus.h"
11 #include "sd-event.h"
12
13 #include "list.h"
14
15 typedef struct Operation Operation;
16
17 #include "machined.h"
18
19 #define OPERATIONS_MAX 64
20
21 struct Operation {
22 Manager *manager;
23 Machine *machine;
24 pid_t pid;
25 sd_bus_message *message;
26 int errno_fd;
27 int extra_fd;
28 sd_event_source *event_source;
29 int (*done)(Operation *o, int ret, sd_bus_error *error);
30 LIST_FIELDS(Operation, operations);
31 LIST_FIELDS(Operation, operations_by_machine);
32 };
33
34 int operation_new(Manager *manager, Machine *machine, pid_t child, sd_bus_message *message, int errno_fd, Operation **ret);
35 Operation *operation_free(Operation *o);