m4: Fix check for yajl.pc
[libvirt/ericb.git] / src / libvirt_internal.h
blob3f012fdd4bef36b13f4a3f6e47cb2171f781b2b5
1 /*
2 * libvirt_internal.h: internally exported APIs, not for public use
4 * Copyright (C) 2006-2014 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/>.
20 * NB This file is ABI sensitive. Things here impact the wire
21 * protocol ABI in the remote driver. Same rules as for things
22 * include/libvirt/libvirt.h apply. ie this file is *append* only
25 #pragma once
27 #include "internal.h"
29 typedef void (*virStateInhibitCallback)(bool inhibit,
30 void *opaque);
32 int virStateInitialize(bool privileged,
33 virStateInhibitCallback inhibit,
34 void *opaque);
35 int virStateCleanup(void);
36 int virStateReload(void);
37 int virStateStop(void);
39 /* Feature detection. This is a libvirt-private interface for determining
40 * what features are supported by the driver.
42 * The remote driver passes features through to the real driver at the
43 * remote end unmodified, except if you query a VIR_DRV_FEATURE_REMOTE*
44 * feature. Queries for VIR_DRV_FEATURE_PROGRAM* features are answered
45 * directly by the RPC layer and not by the real driver.
47 typedef enum {
48 /* Driver supports V1-style virDomainMigrate, ie. domainMigratePrepare/
49 * domainMigratePerform/domainMigrateFinish.
51 VIR_DRV_FEATURE_MIGRATION_V1 = 1,
53 /* Driver is not local. */
54 VIR_DRV_FEATURE_REMOTE = 2,
56 /* Driver supports V2-style virDomainMigrate, ie. domainMigratePrepare2/
57 * domainMigratePerform/domainMigrateFinish2.
59 VIR_DRV_FEATURE_MIGRATION_V2 = 3,
61 /* Driver supports peer-2-peer virDomainMigrate ie source host
62 * does all the prepare/perform/finish steps directly
64 VIR_DRV_FEATURE_MIGRATION_P2P = 4,
66 /* Driver supports migration with only the source host involved,
67 * no libvirtd connetions on the destination at all, only the
68 * perform step is used.
70 VIR_DRV_FEATURE_MIGRATION_DIRECT = 5,
73 * Driver supports V3-style virDomainMigrate, ie domainMigrateBegin3/
74 * domainMigratePrepare3/domainMigratePerform3/domainMigrateFinish3/
75 * domainMigrateConfirm3.
77 VIR_DRV_FEATURE_MIGRATION_V3 = 6,
80 * Driver supports protecting the whole V3-style migration against changes
81 * to domain configuration, i.e., starting from Begin3 and not Perform3.
83 VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION = 7,
86 * Support for file descriptor passing
88 VIR_DRV_FEATURE_FD_PASSING = 8,
91 * Support for VIR_TYPED_PARAM_STRING
93 VIR_DRV_FEATURE_TYPED_PARAM_STRING = 9,
96 * Remote party supports keepalive program (i.e., sending keepalive
97 * messages).
99 VIR_DRV_FEATURE_PROGRAM_KEEPALIVE = 10,
102 * Support for VIR_DOMAIN_XML_MIGRATABLE flag in domainGetXMLDesc
104 VIR_DRV_FEATURE_XML_MIGRATABLE = 11,
107 * Support for offline migration.
109 VIR_DRV_FEATURE_MIGRATION_OFFLINE = 12,
112 * Support for migration parameters.
114 VIR_DRV_FEATURE_MIGRATION_PARAMS = 13,
117 * Support for server-side event filtering via callback ids in events.
119 VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK = 14,
122 * Support for driver close callback rpc
124 VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK = 15,
125 } virDrvFeature;
128 int virConnectSupportsFeature(virConnectPtr conn, int feature);
130 int virDomainMigratePrepare (virConnectPtr dconn,
131 char **cookie,
132 int *cookielen,
133 const char *uri_in,
134 char **uri_out,
135 unsigned long flags,
136 const char *dname,
137 unsigned long resource);
138 int virDomainMigratePerform (virDomainPtr domain,
139 const char *cookie,
140 int cookielen,
141 const char *uri,
142 unsigned long flags,
143 const char *dname,
144 unsigned long resource);
145 virDomainPtr virDomainMigrateFinish (virConnectPtr dconn,
146 const char *dname,
147 const char *cookie,
148 int cookielen,
149 const char *uri,
150 unsigned long flags);
151 int virDomainMigratePrepare2 (virConnectPtr dconn,
152 char **cookie,
153 int *cookielen,
154 const char *uri_in,
155 char **uri_out,
156 unsigned long flags,
157 const char *dname,
158 unsigned long resource,
159 const char *dom_xml);
160 virDomainPtr virDomainMigrateFinish2 (virConnectPtr dconn,
161 const char *dname,
162 const char *cookie,
163 int cookielen,
164 const char *uri,
165 unsigned long flags,
166 int retcode);
167 int virDomainMigratePrepareTunnel(virConnectPtr dconn,
168 virStreamPtr st,
169 unsigned long flags,
170 const char *dname,
171 unsigned long resource,
172 const char *dom_xml);
175 char *virDomainMigrateBegin3(virDomainPtr domain,
176 const char *xmlin,
177 char **cookieout,
178 int *cookieoutlen,
179 unsigned long flags,
180 const char *dname,
181 unsigned long resource);
183 int virDomainMigratePrepare3(virConnectPtr dconn,
184 const char *cookiein,
185 int cookieinlen,
186 char **cookieout,
187 int *cookieoutlen,
188 const char *uri_in,
189 char **uri_out,
190 unsigned long flags,
191 const char *dname,
192 unsigned long resource,
193 const char *dom_xml);
195 int virDomainMigratePrepareTunnel3(virConnectPtr dconn,
196 virStreamPtr st,
197 const char *cookiein,
198 int cookieinlen,
199 char **cookieout,
200 int *cookieoutlen,
201 unsigned long flags,
202 const char *dname,
203 unsigned long resource,
204 const char *dom_xml);
207 int virDomainMigratePerform3(virDomainPtr dom,
208 const char *xmlin,
209 const char *cookiein,
210 int cookieinlen,
211 char **cookieout,
212 int *cookieoutlen,
213 const char *dconnuri, /* libvirtd URI if Peer2Peer, NULL otherwise */
214 const char *uri, /* VM Migration URI */
215 unsigned long flags,
216 const char *dname,
217 unsigned long resource);
219 virDomainPtr virDomainMigrateFinish3(virConnectPtr dconn,
220 const char *dname,
221 const char *cookiein,
222 int cookieinlen,
223 char **cookieout,
224 int *cookieoutlen,
225 const char *dconnuri, /* libvirtd URI if Peer2Peer, NULL otherwise */
226 const char *uri, /* VM Migration URI, NULL in tunnelled case */
227 unsigned long flags,
228 int cancelled); /* Kill the dst VM */
230 int virDomainMigrateConfirm3(virDomainPtr domain,
231 const char *cookiein,
232 int cookieinlen,
233 unsigned long flags,
234 int restart); /* Restart the src VM */
236 char *virDomainMigrateBegin3Params(virDomainPtr domain,
237 virTypedParameterPtr params,
238 int nparams,
239 char **cookieout,
240 int *cookieoutlen,
241 unsigned int flags);
243 int virDomainMigratePrepare3Params(virConnectPtr dconn,
244 virTypedParameterPtr params,
245 int nparams,
246 const char *cookiein,
247 int cookieinlen,
248 char **cookieout,
249 int *cookieoutlen,
250 char **uri_out,
251 unsigned int flags);
253 int virDomainMigratePrepareTunnel3Params(virConnectPtr conn,
254 virStreamPtr st,
255 virTypedParameterPtr params,
256 int nparams,
257 const char *cookiein,
258 int cookieinlen,
259 char **cookieout,
260 int *cookieoutlen,
261 unsigned int flags);
263 int virDomainMigratePerform3Params(virDomainPtr domain,
264 const char *dconnuri,
265 virTypedParameterPtr params,
266 int nparams,
267 const char *cookiein,
268 int cookieinlen,
269 char **cookieout,
270 int *cookieoutlen,
271 unsigned int flags);
273 virDomainPtr virDomainMigrateFinish3Params(virConnectPtr dconn,
274 virTypedParameterPtr params,
275 int nparams,
276 const char *cookiein,
277 int cookieinlen,
278 char **cookieout,
279 int *cookieoutlen,
280 unsigned int flags,
281 int cancelled);
283 int virDomainMigrateConfirm3Params(virDomainPtr domain,
284 virTypedParameterPtr params,
285 int nparams,
286 const char *cookiein,
287 int cookieinlen,
288 unsigned int flags,
289 int cancelled);
292 virTypedParameterValidateSet(virConnectPtr conn,
293 virTypedParameterPtr params,
294 int nparams);
296 int virStreamInData(virStreamPtr stream,
297 int *data,
298 long long *length);