2013-07-18 09:54:21 +00:00
|
|
|
/*
|
|
|
|
* virsystemd.h: helpers for using systemd APIs
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it 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.
|
|
|
|
*
|
|
|
|
* This library 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 this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-06-18 16:13:08 +00:00
|
|
|
#pragma once
|
2013-07-18 09:54:21 +00:00
|
|
|
|
2019-06-18 16:13:08 +00:00
|
|
|
#include "internal.h"
|
2013-07-18 09:54:21 +00:00
|
|
|
|
2019-06-25 12:03:56 +00:00
|
|
|
typedef struct _virSystemdActivation virSystemdActivation;
|
|
|
|
typedef virSystemdActivation *virSystemdActivationPtr;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Back compat for systemd < v227 which lacks LISTEN_FDNAMES.
|
|
|
|
* Delete when min systemd is increased ie RHEL7 dropped
|
|
|
|
*/
|
|
|
|
typedef struct _virSystemdActivationMap {
|
|
|
|
const char *name;
|
|
|
|
int family;
|
|
|
|
int port; /* if family == AF_INET/AF_INET6 */
|
|
|
|
const char *path; /* if family == AF_UNIX */
|
|
|
|
} virSystemdActivationMap;
|
|
|
|
|
2013-07-26 14:18:55 +00:00
|
|
|
char *virSystemdMakeScopeName(const char *name,
|
2016-02-01 15:50:54 +00:00
|
|
|
const char *drivername,
|
|
|
|
bool legacy_behaviour);
|
2013-07-26 14:18:55 +00:00
|
|
|
char *virSystemdMakeSliceName(const char *partition);
|
|
|
|
|
2013-07-18 09:54:21 +00:00
|
|
|
int virSystemdCreateMachine(const char *name,
|
|
|
|
const char *drivername,
|
|
|
|
const unsigned char *uuid,
|
|
|
|
const char *rootdir,
|
|
|
|
pid_t pidleader,
|
|
|
|
bool iscontainer,
|
2014-11-11 17:38:43 +00:00
|
|
|
size_t nnicindexes,
|
|
|
|
int *nicindexes,
|
2013-07-18 09:54:21 +00:00
|
|
|
const char *partition);
|
|
|
|
|
2016-02-01 15:50:54 +00:00
|
|
|
int virSystemdTerminateMachine(const char *name);
|
2013-09-30 14:46:29 +00:00
|
|
|
|
2014-02-21 12:06:42 +00:00
|
|
|
void virSystemdNotifyStartup(void);
|
|
|
|
|
2014-04-11 07:20:48 +00:00
|
|
|
int virSystemdCanSuspend(bool *result);
|
|
|
|
|
|
|
|
int virSystemdCanHibernate(bool *result);
|
|
|
|
|
|
|
|
int virSystemdCanHybridSleep(bool *result);
|
|
|
|
|
2016-02-02 18:45:55 +00:00
|
|
|
char *virSystemdGetMachineNameByPID(pid_t pid);
|
2019-06-25 12:03:56 +00:00
|
|
|
|
|
|
|
int virSystemdGetActivation(virSystemdActivationMap *map,
|
|
|
|
size_t nmap,
|
|
|
|
virSystemdActivationPtr *act);
|
|
|
|
|
|
|
|
bool virSystemdActivationHasName(virSystemdActivationPtr act,
|
|
|
|
const char *name);
|
|
|
|
|
|
|
|
int virSystemdActivationComplete(virSystemdActivationPtr act);
|
|
|
|
|
|
|
|
void virSystemdActivationClaimFDs(virSystemdActivationPtr act,
|
|
|
|
const char *name,
|
|
|
|
int **fds,
|
|
|
|
size_t *nfds);
|
|
|
|
|
|
|
|
void virSystemdActivationFree(virSystemdActivationPtr *act);
|
|
|
|
|
|
|
|
#define virSystemdActivationAutoPtrFree virSystemdActivationFree
|