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
,
33 int virStateInitialize(bool privileged
,
34 virStateInhibitCallback inhibit
,
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.
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
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,
129 int virConnectSupportsFeature(virConnectPtr conn
, int feature
);
131 int virDomainMigratePrepare (virConnectPtr dconn
,
138 unsigned long resource
);
139 int virDomainMigratePerform (virDomainPtr domain
,
145 unsigned long resource
);
146 virDomainPtr
virDomainMigrateFinish (virConnectPtr dconn
,
151 unsigned long flags
);
152 int virDomainMigratePrepare2 (virConnectPtr dconn
,
159 unsigned long resource
,
160 const char *dom_xml
);
161 virDomainPtr
virDomainMigrateFinish2 (virConnectPtr dconn
,
168 int virDomainMigratePrepareTunnel(virConnectPtr dconn
,
172 unsigned long resource
,
173 const char *dom_xml
);
176 char *virDomainMigrateBegin3(virDomainPtr domain
,
182 unsigned long resource
);
184 int virDomainMigratePrepare3(virConnectPtr dconn
,
185 const char *cookiein
,
193 unsigned long resource
,
194 const char *dom_xml
);
196 int virDomainMigratePrepareTunnel3(virConnectPtr dconn
,
198 const char *cookiein
,
204 unsigned long resource
,
205 const char *dom_xml
);
208 int virDomainMigratePerform3(virDomainPtr dom
,
210 const char *cookiein
,
214 const char *dconnuri
, /* libvirtd URI if Peer2Peer, NULL otherwise */
215 const char *uri
, /* VM Migration URI */
218 unsigned long resource
);
220 virDomainPtr
virDomainMigrateFinish3(virConnectPtr dconn
,
222 const char *cookiein
,
226 const char *dconnuri
, /* libvirtd URI if Peer2Peer, NULL otherwise */
227 const char *uri
, /* VM Migration URI, NULL in tunnelled case */
229 int cancelled
); /* Kill the dst VM */
231 int virDomainMigrateConfirm3(virDomainPtr domain
,
232 const char *cookiein
,
235 int restart
); /* Restart the src VM */
237 char *virDomainMigrateBegin3Params(virDomainPtr domain
,
238 virTypedParameterPtr params
,
244 int virDomainMigratePrepare3Params(virConnectPtr dconn
,
245 virTypedParameterPtr params
,
247 const char *cookiein
,
254 int virDomainMigratePrepareTunnel3Params(virConnectPtr conn
,
256 virTypedParameterPtr params
,
258 const char *cookiein
,
264 int virDomainMigratePerform3Params(virDomainPtr domain
,
265 const char *dconnuri
,
266 virTypedParameterPtr params
,
268 const char *cookiein
,
274 virDomainPtr
virDomainMigrateFinish3Params(virConnectPtr dconn
,
275 virTypedParameterPtr params
,
277 const char *cookiein
,
284 int virDomainMigrateConfirm3Params(virDomainPtr domain
,
285 virTypedParameterPtr params
,
287 const char *cookiein
,
293 virTypedParameterValidateSet(virConnectPtr conn
,
294 virTypedParameterPtr params
,
297 int virStreamInData(virStreamPtr stream
,
301 #endif /* LIBVIRT_LIBVIRT_INTERNAL_H */