machine.h revision 49f3fffd94591bdf2bd6c2233a9300daeab79566
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2013 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
typedef struct MachineOperation MachineOperation;
#include "list.h"
#include "machined.h"
typedef enum MachineState {
MACHINE_OPENING, /* Machine is being registered */
MACHINE_RUNNING, /* Machine is running */
MACHINE_CLOSING, /* Machine is terminating */
} MachineState;
typedef enum MachineClass {
} MachineClass;
enum KillWho {
_KILL_WHO_INVALID = -1
};
#define MACHINE_OPERATIONS_MAX 64
struct MachineOperation {
int errno_fd;
};
struct Machine {
char *name;
char *state_file;
char *service;
char *root_directory;
char *unit;
char *scope_job;
bool in_gc_queue:1;
bool started:1;
bool stopping:1;
int *netif;
unsigned n_netif;
unsigned n_operations;
};
void machine_free(Machine *m);
void machine_add_to_gc_queue(Machine *m);
int machine_stop(Machine *m);
int machine_finalize(Machine *m);
int machine_save(Machine *m);
int machine_load(Machine *m);
void machine_release_unit(Machine *m);