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
29 typedef void (*virStateInhibitCallback
)(bool inhibit
,
32 int virStateInitialize(bool privileged
,
33 virStateInhibitCallback inhibit
,
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.
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
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,
128 int virConnectSupportsFeature(virConnectPtr conn
, int feature
);
130 int virDomainMigratePrepare (virConnectPtr dconn
,
137 unsigned long resource
);
138 int virDomainMigratePerform (virDomainPtr domain
,
144 unsigned long resource
);
145 virDomainPtr
virDomainMigrateFinish (virConnectPtr dconn
,
150 unsigned long flags
);
151 int virDomainMigratePrepare2 (virConnectPtr dconn
,
158 unsigned long resource
,
159 const char *dom_xml
);
160 virDomainPtr
virDomainMigrateFinish2 (virConnectPtr dconn
,
167 int virDomainMigratePrepareTunnel(virConnectPtr dconn
,
171 unsigned long resource
,
172 const char *dom_xml
);
175 char *virDomainMigrateBegin3(virDomainPtr domain
,
181 unsigned long resource
);
183 int virDomainMigratePrepare3(virConnectPtr dconn
,
184 const char *cookiein
,
192 unsigned long resource
,
193 const char *dom_xml
);
195 int virDomainMigratePrepareTunnel3(virConnectPtr dconn
,
197 const char *cookiein
,
203 unsigned long resource
,
204 const char *dom_xml
);
207 int virDomainMigratePerform3(virDomainPtr dom
,
209 const char *cookiein
,
213 const char *dconnuri
, /* libvirtd URI if Peer2Peer, NULL otherwise */
214 const char *uri
, /* VM Migration URI */
217 unsigned long resource
);
219 virDomainPtr
virDomainMigrateFinish3(virConnectPtr dconn
,
221 const char *cookiein
,
225 const char *dconnuri
, /* libvirtd URI if Peer2Peer, NULL otherwise */
226 const char *uri
, /* VM Migration URI, NULL in tunnelled case */
228 int cancelled
); /* Kill the dst VM */
230 int virDomainMigrateConfirm3(virDomainPtr domain
,
231 const char *cookiein
,
234 int restart
); /* Restart the src VM */
236 char *virDomainMigrateBegin3Params(virDomainPtr domain
,
237 virTypedParameterPtr params
,
243 int virDomainMigratePrepare3Params(virConnectPtr dconn
,
244 virTypedParameterPtr params
,
246 const char *cookiein
,
253 int virDomainMigratePrepareTunnel3Params(virConnectPtr conn
,
255 virTypedParameterPtr params
,
257 const char *cookiein
,
263 int virDomainMigratePerform3Params(virDomainPtr domain
,
264 const char *dconnuri
,
265 virTypedParameterPtr params
,
267 const char *cookiein
,
273 virDomainPtr
virDomainMigrateFinish3Params(virConnectPtr dconn
,
274 virTypedParameterPtr params
,
276 const char *cookiein
,
283 int virDomainMigrateConfirm3Params(virDomainPtr domain
,
284 virTypedParameterPtr params
,
286 const char *cookiein
,
292 virTypedParameterValidateSet(virConnectPtr conn
,
293 virTypedParameterPtr params
,
296 int virStreamInData(virStreamPtr stream
,