machine: Remove circular header dependencies
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "bus-get-properties.h"
|
||||
#include "bus-label.h"
|
||||
#include "bus-polkit.h"
|
||||
#include "bus-util.h"
|
||||
#include "copy.h"
|
||||
#include "discover-image.h"
|
||||
#include "dissect-image.h"
|
||||
@@ -16,7 +17,9 @@
|
||||
#include "image-dbus.h"
|
||||
#include "io-util.h"
|
||||
#include "loop-util.h"
|
||||
#include "machined.h"
|
||||
#include "mount-util.h"
|
||||
#include "operation.h"
|
||||
#include "os-util.h"
|
||||
#include "process-util.h"
|
||||
#include "raw-clone.h"
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "bus-object.h"
|
||||
#include "discover-image.h"
|
||||
#include "machined.h"
|
||||
|
||||
extern const BusObjectImplementation image_object;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "bus-polkit.h"
|
||||
#include "btrfs-util.h"
|
||||
#include "discover-image.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "image.h"
|
||||
@@ -12,7 +13,9 @@
|
||||
#include "io-util.h"
|
||||
#include "json-util.h"
|
||||
#include "machine.h"
|
||||
#include "machined.h"
|
||||
#include "machine-pool.h"
|
||||
#include "operation.h"
|
||||
#include "process-util.h"
|
||||
#include "string-util.h"
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "fileio.h"
|
||||
#include "image.h"
|
||||
#include "io-util.h"
|
||||
#include "machined.h"
|
||||
#include "operation.h"
|
||||
#include "process-util.h"
|
||||
#include "string-table.h"
|
||||
|
||||
+8
-2
@@ -1,8 +1,14 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "machined.h"
|
||||
#include "operation.h"
|
||||
#include <errno.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
typedef struct Manager Manager;
|
||||
typedef struct Operation Operation;
|
||||
|
||||
typedef enum ImageCleanPoolMode {
|
||||
IMAGE_CLEAN_POOL_REMOVE_ALL,
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "bus-label.h"
|
||||
#include "bus-locator.h"
|
||||
#include "bus-polkit.h"
|
||||
#include "bus-util.h"
|
||||
#include "copy.h"
|
||||
#include "env-file.h"
|
||||
#include "env-util.h"
|
||||
@@ -22,10 +23,12 @@
|
||||
#include "local-addresses.h"
|
||||
#include "machine-dbus.h"
|
||||
#include "machine.h"
|
||||
#include "machined.h"
|
||||
#include "mkdir.h"
|
||||
#include "mount-util.h"
|
||||
#include "mountpoint-util.h"
|
||||
#include "namespace-util.h"
|
||||
#include "operation.h"
|
||||
#include "os-util.h"
|
||||
#include "path-util.h"
|
||||
#include "process-util.h"
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "bus-util.h"
|
||||
#include "machine.h"
|
||||
#include "bus-object.h"
|
||||
|
||||
typedef struct Machine Machine;
|
||||
|
||||
typedef enum {
|
||||
MACHINE_COPY_REPLACE = 1 << 0, /* Public API via DBUS, do not change */
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
#include "json-util.h"
|
||||
#include "machine-varlink.h"
|
||||
#include "machine.h"
|
||||
#include "machined.h"
|
||||
#include "mount-util.h"
|
||||
#include "operation.h"
|
||||
#include "path-util.h"
|
||||
#include "pidref.h"
|
||||
#include "process-util.h"
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
|
||||
#include "sd-varlink.h"
|
||||
|
||||
#include "machine.h"
|
||||
#include "pidref.h"
|
||||
|
||||
typedef struct Machine Machine;
|
||||
typedef struct Manager Manager;
|
||||
|
||||
#define VARLINK_ERROR_MACHINE_NO_SUCH_MACHINE "io.systemd.Machine.NoSuchMachine"
|
||||
#define VARLINK_ERROR_MACHINE_EXISTS "io.systemd.Machine.MachineExists"
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
#include "hashmap.h"
|
||||
#include "machine-dbus.h"
|
||||
#include "machine.h"
|
||||
#include "machined.h"
|
||||
#include "mkdir-label.h"
|
||||
#include "namespace-util.h"
|
||||
#include "operation.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "process-util.h"
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
typedef struct Machine Machine;
|
||||
typedef enum KillWhom KillWhom;
|
||||
#include "sd-bus.h"
|
||||
#include "sd-event.h"
|
||||
#include "sd-id128.h"
|
||||
|
||||
#include "copy.h"
|
||||
#include "list.h"
|
||||
#include "machined.h"
|
||||
#include "operation.h"
|
||||
#include "pidref.h"
|
||||
#include "time-util.h"
|
||||
|
||||
typedef struct Machine Machine;
|
||||
typedef struct Manager Manager;
|
||||
typedef struct Operation Operation;
|
||||
|
||||
typedef enum MachineState {
|
||||
MACHINE_OPENING, /* Machine is being registered */
|
||||
MACHINE_RUNNING, /* Machine is running */
|
||||
@@ -27,12 +30,12 @@ typedef enum MachineClass {
|
||||
_MACHINE_CLASS_INVALID = -EINVAL,
|
||||
} MachineClass;
|
||||
|
||||
enum KillWhom {
|
||||
typedef enum KillWhom {
|
||||
KILL_LEADER,
|
||||
KILL_ALL,
|
||||
_KILL_WHOM_MAX,
|
||||
_KILL_WHOM_INVALID = -EINVAL,
|
||||
};
|
||||
} KillWhom;
|
||||
|
||||
struct Machine {
|
||||
Manager *manager;
|
||||
|
||||
@@ -2,12 +2,16 @@
|
||||
|
||||
#include "cgroup-util.h"
|
||||
#include "copy.h"
|
||||
#include "discover-image.h"
|
||||
#include "env-file.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "iovec-util.h"
|
||||
#include "log.h"
|
||||
#include "machine.h"
|
||||
#include "machined.h"
|
||||
#include "namespace-util.h"
|
||||
#include "os-util.h"
|
||||
#include "process-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "strv.h"
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "bus-locator.h"
|
||||
#include "bus-message-util.h"
|
||||
#include "bus-polkit.h"
|
||||
#include "bus-util.h"
|
||||
#include "cgroup-util.h"
|
||||
#include "discover-image.h"
|
||||
#include "errno-util.h"
|
||||
@@ -24,7 +25,9 @@
|
||||
#include "io-util.h"
|
||||
#include "machine-dbus.h"
|
||||
#include "machine-pool.h"
|
||||
#include "machine.h"
|
||||
#include "machined.h"
|
||||
#include "operation.h"
|
||||
#include "os-util.h"
|
||||
#include "path-util.h"
|
||||
#include "process-util.h"
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "image-varlink.h"
|
||||
#include "json-util.h"
|
||||
#include "machine-varlink.h"
|
||||
#include "machine.h"
|
||||
#include "machined.h"
|
||||
#include "machined-varlink.h"
|
||||
#include "mkdir.h"
|
||||
#include "process-util.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "machined.h"
|
||||
typedef struct Manager Manager;
|
||||
|
||||
int manager_varlink_init(Manager *m);
|
||||
void manager_varlink_done(Manager *m);
|
||||
|
||||
@@ -19,10 +19,12 @@
|
||||
#include "fd-util.h"
|
||||
#include "format-util.h"
|
||||
#include "hostname-util.h"
|
||||
#include "machine.h"
|
||||
#include "machined-varlink.h"
|
||||
#include "machined.h"
|
||||
#include "main-func.h"
|
||||
#include "mkdir-label.h"
|
||||
#include "operation.h"
|
||||
#include "process-util.h"
|
||||
#include "service-util.h"
|
||||
#include "signal-util.h"
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
#include "sd-event.h"
|
||||
#include "sd-varlink.h"
|
||||
|
||||
typedef struct Manager Manager;
|
||||
|
||||
#include "bus-object.h"
|
||||
#include "hashmap.h"
|
||||
#include "image-dbus.h"
|
||||
#include "list.h"
|
||||
#include "local-addresses.h"
|
||||
#include "machine-dbus.h"
|
||||
#include "machine.h"
|
||||
#include "operation.h"
|
||||
#include "pidref.h"
|
||||
#include "runtime-scope.h"
|
||||
|
||||
struct Manager {
|
||||
typedef struct Image Image;
|
||||
typedef struct Machine Machine;
|
||||
typedef struct Operation Operation;
|
||||
|
||||
typedef struct Manager {
|
||||
sd_event *event;
|
||||
sd_bus *bus;
|
||||
|
||||
@@ -44,7 +44,7 @@ struct Manager {
|
||||
sd_varlink_server *varlink_machine_server;
|
||||
|
||||
RuntimeScope runtime_scope; /* for now: always RUNTIME_SCOPE_SYSTEM */
|
||||
};
|
||||
} Manager;
|
||||
|
||||
int manager_add_machine(Manager *m, const char *name, Machine **ret);
|
||||
int manager_get_machine_by_pidref(Manager *m, const PidRef *pidref, Machine **ret);
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "log.h"
|
||||
#include "machine.h"
|
||||
#include "machined.h"
|
||||
#include "operation.h"
|
||||
#include "process-util.h"
|
||||
|
||||
|
||||
@@ -5,13 +5,14 @@
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-event.h"
|
||||
#include "sd-varlink.h"
|
||||
|
||||
#include "list.h"
|
||||
|
||||
typedef struct Machine Machine;
|
||||
typedef struct Manager Manager;
|
||||
typedef struct Operation Operation;
|
||||
|
||||
#include "machined.h"
|
||||
|
||||
#define OPERATIONS_MAX 64
|
||||
|
||||
struct Operation {
|
||||
|
||||
Reference in New Issue
Block a user