4 * Copyright (C) 2015 Red Hat, Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see
18 * <http://www.gnu.org/licenses/>.
26 #include "virnetserverprogram.h"
27 #include "virnetserverclient.h"
28 #include "virnetserver.h"
30 virNetDaemon
*virNetDaemonNew(void);
32 int virNetDaemonAddServer(virNetDaemon
*dmn
,
35 typedef virNetServer
*(*virNetDaemonNewServerPostExecRestart
)(virNetDaemon
*dmn
,
39 virNetDaemon
*virNetDaemonNewPostExecRestart(virJSONValue
*object
,
40 size_t nDefServerNames
,
41 const char **defServerNames
,
42 virNetDaemonNewServerPostExecRestart cb
,
45 virJSONValue
*virNetDaemonPreExecRestart(virNetDaemon
*dmn
);
47 bool virNetDaemonIsPrivileged(virNetDaemon
*dmn
);
49 int virNetDaemonAutoShutdown(virNetDaemon
*dmn
,
50 unsigned int timeout
) G_GNUC_WARN_UNUSED_RESULT
;
52 void virNetDaemonAddShutdownInhibition(virNetDaemon
*dmn
);
53 void virNetDaemonRemoveShutdownInhibition(virNetDaemon
*dmn
);
56 # define siginfo_t void
59 typedef void (*virNetDaemonSignalFunc
)(virNetDaemon
*dmn
, siginfo_t
*info
, void *opaque
);
61 int virNetDaemonAddSignalHandler(virNetDaemon
*dmn
,
63 virNetDaemonSignalFunc func
,
66 void virNetDaemonUpdateServices(virNetDaemon
*dmn
,
69 void virNetDaemonSetStateStopWorkerThread(virNetDaemon
*dmn
,
72 void virNetDaemonRun(virNetDaemon
*dmn
);
74 void virNetDaemonQuit(virNetDaemon
*dmn
);
75 void virNetDaemonQuitExecRestart(virNetDaemon
*dmn
);
77 bool virNetDaemonHasClients(virNetDaemon
*dmn
);
79 virNetServer
*virNetDaemonGetServer(virNetDaemon
*dmn
,
80 const char *serverName
);
81 ssize_t
virNetDaemonGetServers(virNetDaemon
*dmn
, virNetServer
***servers
);
82 bool virNetDaemonHasServer(virNetDaemon
*dmn
,
83 const char *serverName
);
85 typedef int (*virNetDaemonShutdownCallback
)(void);
87 void virNetDaemonSetShutdownCallbacks(virNetDaemon
*dmn
,
88 virNetDaemonShutdownCallback prepareCb
,
89 virNetDaemonShutdownCallback waitCb
);