qemu: Fix leak in qemuProcessInitCpuAffinity()
[libvirt/ericb.git] / src / libvirt_internal.h
blob8be1257814c913f5eec8eb1b13250b94552720a9
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 #ifndef LIBVIRT_LIBVIRT_INTERNAL_H
26 # define LIBVIRT_LIBVIRT_INTERNAL_H
28 # include "internal.h"
30 typedef void (*virStateInhibitCallback)(bool inhibit,
31 void *opaque);
33 int virStateInitialize(bool privileged,
34 virStateInhibitCallback inhibit,
35 void *opaque);
36 int virStateCleanup(void);
37 int virStateReload(void);
38 int virStateStop(void);
40 /* Feature detection. This is a libvirt-private interface for determining
41 * what features are supported by the driver.
43 * The remote driver passes features through to the real driver at the
44 * remote end unmodified, except if you query a VIR_DRV_FEATURE_REMOTE*
45 * feature. Queries for VIR_DRV_FEATURE_PROGRAM* features are answered
46 * directly by the RPC layer and not by the real driver.
48 typedef enum {
49 /* Driver supports V1-style virDomainMigrate, ie. domainMigratePrepare/
50 * domainMigratePerform/domainMigrateFinish.
52 VIR_DRV_FEATURE_MIGRATION_V1 = 1,
54 /* Driver is not local. */
55 VIR_DRV_FEATURE_REMOTE = 2,
57 /* Driver supports V2-style virDomainMigrate, ie. domainMigratePrepare2/
58 * domainMigratePerform/domainMigrateFinish2.
60 VIR_DRV_FEATURE_MIGRATION_V2 = 3,
62 /* Driver supports peer-2-peer virDomainMigrate ie source host
63 * does all the prepare/perform/finish steps directly
65 VIR_DRV_FEATURE_MIGRATION_P2P = 4,
67 /* Driver supports migration with only the source host involved,
68 * no libvirtd connetions on the destination at all, only the
69 * perform step is used.
71 VIR_DRV_FEATURE_MIGRATION_DIRECT = 5,
74 * Driver supports V3-style virDomainMigrate, ie domainMigrateBegin3/
75 * domainMigratePrepare3/domainMigratePerform3/domainMigrateFinish3/
76 * domainMigrateConfirm3.
78 VIR_DRV_FEATURE_MIGRATION_V3 = 6,
81 * Driver supports protecting the whole V3-style migration against changes
82 * to domain configuration, i.e., starting from Begin3 and not Perform3.
84 VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION = 7,
87 * Support for file descriptor passing
89 VIR_DRV_FEATURE_FD_PASSING = 8,
92 * Support for VIR_TYPED_PARAM_STRING
94 VIR_DRV_FEATURE_TYPED_PARAM_STRING = 9,
97 * Remote party supports keepalive program (i.e., sending keepalive
98 * messages).
100 VIR_DRV_FEATURE_PROGRAM_KEEPALIVE = 10,
103 * Support for VIR_DOMAIN_XML_MIGRATABLE flag in domainGetXMLDesc
105 VIR_DRV_FEATURE_XML_MIGRATABLE = 11,
108 * Support for offline migration.
110 VIR_DRV_FEATURE_MIGRATION_OFFLINE = 12,
113 * Support for migration parameters.
115 VIR_DRV_FEATURE_MIGRATION_PARAMS = 13,
118 * Support for server-side event filtering via callback ids in events.
120 VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK = 14,
123 * Support for driver close callback rpc
125 VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK = 15,
126 } virDrvFeature;
129 int virConnectSupportsFeature(virConnectPtr conn, int feature);
131 int virDomainMigratePrepare (virConnectPtr dconn,
132 char **cookie,
133 int *cookielen,
134 const char *uri_in,
135 char **uri_out,
136 unsigned long flags,
137 const char *dname,
138 unsigned long resource);
139 int virDomainMigratePerform (virDomainPtr domain,
140 const char *cookie,
141 int cookielen,
142 const char *uri,
143 unsigned long flags,
144 const char *dname,
145 unsigned long resource);
146 virDomainPtr virDomainMigrateFinish (virConnectPtr dconn,
147 const char *dname,
148 const char *cookie,
149 int cookielen,
150 const char *uri,
151 unsigned long flags);
152 int virDomainMigratePrepare2 (virConnectPtr dconn,
153 char **cookie,
154 int *cookielen,
155 const char *uri_in,
156 char **uri_out,
157 unsigned long flags,
158 const char *dname,
159 unsigned long resource,
160 const char *dom_xml);
161 virDomainPtr virDomainMigrateFinish2 (virConnectPtr dconn,
162 const char *dname,
163 const char *cookie,
164 int cookielen,
165 const char *uri,
166 unsigned long flags,
167 int retcode);
168 int virDomainMigratePrepareTunnel(virConnectPtr dconn,
169 virStreamPtr st,
170 unsigned long flags,
171 const char *dname,
172 unsigned long resource,
173 const char *dom_xml);
176 char *virDomainMigrateBegin3(virDomainPtr domain,
177 const char *xmlin,
178 char **cookieout,
179 int *cookieoutlen,
180 unsigned long flags,
181 const char *dname,
182 unsigned long resource);
184 int virDomainMigratePrepare3(virConnectPtr dconn,
185 const char *cookiein,
186 int cookieinlen,
187 char **cookieout,
188 int *cookieoutlen,
189 const char *uri_in,
190 char **uri_out,
191 unsigned long flags,
192 const char *dname,
193 unsigned long resource,
194 const char *dom_xml);
196 int virDomainMigratePrepareTunnel3(virConnectPtr dconn,
197 virStreamPtr st,
198 const char *cookiein,
199 int cookieinlen,
200 char **cookieout,
201 int *cookieoutlen,
202 unsigned long flags,
203 const char *dname,
204 unsigned long resource,
205 const char *dom_xml);
208 int virDomainMigratePerform3(virDomainPtr dom,
209 const char *xmlin,
210 const char *cookiein,
211 int cookieinlen,
212 char **cookieout,
213 int *cookieoutlen,
214 const char *dconnuri, /* libvirtd URI if Peer2Peer, NULL otherwise */
215 const char *uri, /* VM Migration URI */
216 unsigned long flags,
217 const char *dname,
218 unsigned long resource);
220 virDomainPtr virDomainMigrateFinish3(virConnectPtr dconn,
221 const char *dname,
222 const char *cookiein,
223 int cookieinlen,
224 char **cookieout,
225 int *cookieoutlen,
226 const char *dconnuri, /* libvirtd URI if Peer2Peer, NULL otherwise */
227 const char *uri, /* VM Migration URI, NULL in tunnelled case */
228 unsigned long flags,
229 int cancelled); /* Kill the dst VM */
231 int virDomainMigrateConfirm3(virDomainPtr domain,
232 const char *cookiein,
233 int cookieinlen,
234 unsigned long flags,
235 int restart); /* Restart the src VM */
237 char *virDomainMigrateBegin3Params(virDomainPtr domain,
238 virTypedParameterPtr params,
239 int nparams,
240 char **cookieout,
241 int *cookieoutlen,
242 unsigned int flags);
244 int virDomainMigratePrepare3Params(virConnectPtr dconn,
245 virTypedParameterPtr params,
246 int nparams,
247 const char *cookiein,
248 int cookieinlen,
249 char **cookieout,
250 int *cookieoutlen,
251 char **uri_out,
252 unsigned int flags);
254 int virDomainMigratePrepareTunnel3Params(virConnectPtr conn,
255 virStreamPtr st,
256 virTypedParameterPtr params,
257 int nparams,
258 const char *cookiein,
259 int cookieinlen,
260 char **cookieout,
261 int *cookieoutlen,
262 unsigned int flags);
264 int virDomainMigratePerform3Params(virDomainPtr domain,
265 const char *dconnuri,
266 virTypedParameterPtr params,
267 int nparams,
268 const char *cookiein,
269 int cookieinlen,
270 char **cookieout,
271 int *cookieoutlen,
272 unsigned int flags);
274 virDomainPtr virDomainMigrateFinish3Params(virConnectPtr dconn,
275 virTypedParameterPtr params,
276 int nparams,
277 const char *cookiein,
278 int cookieinlen,
279 char **cookieout,
280 int *cookieoutlen,
281 unsigned int flags,
282 int cancelled);
284 int virDomainMigrateConfirm3Params(virDomainPtr domain,
285 virTypedParameterPtr params,
286 int nparams,
287 const char *cookiein,
288 int cookieinlen,
289 unsigned int flags,
290 int cancelled);
293 virTypedParameterValidateSet(virConnectPtr conn,
294 virTypedParameterPtr params,
295 int nparams);
297 int virStreamInData(virStreamPtr stream,
298 int *data,
299 long long *length);
301 #endif /* LIBVIRT_LIBVIRT_INTERNAL_H */