1 | /* AUTOMATICALLY GENERATED, DO NOT MODIFY */ |
2 | |
3 | /* |
4 | * Schema-defined QAPI types |
5 | * |
6 | * Copyright IBM, Corp. 2011 |
7 | * Copyright (c) 2013-2018 Red Hat Inc. |
8 | * |
9 | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. |
10 | * See the COPYING.LIB file in the top-level directory. |
11 | */ |
12 | |
13 | #ifndef QAPI_TYPES_MIGRATION_H |
14 | #define QAPI_TYPES_MIGRATION_H |
15 | |
16 | #include "qapi/qapi-builtin-types.h" |
17 | #include "qapi-types-common.h" |
18 | #include "qapi-types-sockets.h" |
19 | |
20 | typedef struct MigrationStats MigrationStats; |
21 | |
22 | typedef struct XBZRLECacheStats XBZRLECacheStats; |
23 | |
24 | typedef struct CompressionStats CompressionStats; |
25 | |
26 | typedef enum MigrationStatus { |
27 | MIGRATION_STATUS_NONE, |
28 | MIGRATION_STATUS_SETUP, |
29 | MIGRATION_STATUS_CANCELLING, |
30 | MIGRATION_STATUS_CANCELLED, |
31 | MIGRATION_STATUS_ACTIVE, |
32 | MIGRATION_STATUS_POSTCOPY_ACTIVE, |
33 | MIGRATION_STATUS_POSTCOPY_PAUSED, |
34 | MIGRATION_STATUS_POSTCOPY_RECOVER, |
35 | MIGRATION_STATUS_COMPLETED, |
36 | MIGRATION_STATUS_FAILED, |
37 | MIGRATION_STATUS_COLO, |
38 | MIGRATION_STATUS_PRE_SWITCHOVER, |
39 | MIGRATION_STATUS_DEVICE, |
40 | MIGRATION_STATUS__MAX, |
41 | } MigrationStatus; |
42 | |
43 | #define MigrationStatus_str(val) \ |
44 | qapi_enum_lookup(&MigrationStatus_lookup, (val)) |
45 | |
46 | extern const QEnumLookup MigrationStatus_lookup; |
47 | |
48 | typedef struct MigrationInfo MigrationInfo; |
49 | |
50 | typedef enum MigrationCapability { |
51 | MIGRATION_CAPABILITY_XBZRLE, |
52 | MIGRATION_CAPABILITY_RDMA_PIN_ALL, |
53 | MIGRATION_CAPABILITY_AUTO_CONVERGE, |
54 | MIGRATION_CAPABILITY_ZERO_BLOCKS, |
55 | MIGRATION_CAPABILITY_COMPRESS, |
56 | MIGRATION_CAPABILITY_EVENTS, |
57 | MIGRATION_CAPABILITY_POSTCOPY_RAM, |
58 | MIGRATION_CAPABILITY_X_COLO, |
59 | MIGRATION_CAPABILITY_RELEASE_RAM, |
60 | MIGRATION_CAPABILITY_BLOCK, |
61 | MIGRATION_CAPABILITY_RETURN_PATH, |
62 | MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER, |
63 | MIGRATION_CAPABILITY_MULTIFD, |
64 | MIGRATION_CAPABILITY_DIRTY_BITMAPS, |
65 | MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME, |
66 | MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE, |
67 | MIGRATION_CAPABILITY_X_IGNORE_SHARED, |
68 | MIGRATION_CAPABILITY__MAX, |
69 | } MigrationCapability; |
70 | |
71 | #define MigrationCapability_str(val) \ |
72 | qapi_enum_lookup(&MigrationCapability_lookup, (val)) |
73 | |
74 | extern const QEnumLookup MigrationCapability_lookup; |
75 | |
76 | typedef struct MigrationCapabilityStatus MigrationCapabilityStatus; |
77 | |
78 | typedef struct MigrationCapabilityStatusList MigrationCapabilityStatusList; |
79 | |
80 | typedef struct q_obj_migrate_set_capabilities_arg q_obj_migrate_set_capabilities_arg; |
81 | |
82 | typedef enum MigrationParameter { |
83 | MIGRATION_PARAMETER_ANNOUNCE_INITIAL, |
84 | MIGRATION_PARAMETER_ANNOUNCE_MAX, |
85 | MIGRATION_PARAMETER_ANNOUNCE_ROUNDS, |
86 | MIGRATION_PARAMETER_ANNOUNCE_STEP, |
87 | MIGRATION_PARAMETER_COMPRESS_LEVEL, |
88 | MIGRATION_PARAMETER_COMPRESS_THREADS, |
89 | MIGRATION_PARAMETER_DECOMPRESS_THREADS, |
90 | MIGRATION_PARAMETER_COMPRESS_WAIT_THREAD, |
91 | MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL, |
92 | MIGRATION_PARAMETER_CPU_THROTTLE_INCREMENT, |
93 | MIGRATION_PARAMETER_TLS_CREDS, |
94 | MIGRATION_PARAMETER_TLS_HOSTNAME, |
95 | MIGRATION_PARAMETER_TLS_AUTHZ, |
96 | MIGRATION_PARAMETER_MAX_BANDWIDTH, |
97 | MIGRATION_PARAMETER_DOWNTIME_LIMIT, |
98 | MIGRATION_PARAMETER_X_CHECKPOINT_DELAY, |
99 | MIGRATION_PARAMETER_BLOCK_INCREMENTAL, |
100 | MIGRATION_PARAMETER_MULTIFD_CHANNELS, |
101 | MIGRATION_PARAMETER_XBZRLE_CACHE_SIZE, |
102 | MIGRATION_PARAMETER_MAX_POSTCOPY_BANDWIDTH, |
103 | MIGRATION_PARAMETER_MAX_CPU_THROTTLE, |
104 | MIGRATION_PARAMETER__MAX, |
105 | } MigrationParameter; |
106 | |
107 | #define MigrationParameter_str(val) \ |
108 | qapi_enum_lookup(&MigrationParameter_lookup, (val)) |
109 | |
110 | extern const QEnumLookup MigrationParameter_lookup; |
111 | |
112 | typedef struct MigrateSetParameters MigrateSetParameters; |
113 | |
114 | typedef struct MigrationParameters MigrationParameters; |
115 | |
116 | typedef struct q_obj_client_migrate_info_arg q_obj_client_migrate_info_arg; |
117 | |
118 | typedef struct q_obj_MIGRATION_arg q_obj_MIGRATION_arg; |
119 | |
120 | typedef struct q_obj_MIGRATION_PASS_arg q_obj_MIGRATION_PASS_arg; |
121 | |
122 | typedef enum COLOMessage { |
123 | COLO_MESSAGE_CHECKPOINT_READY, |
124 | COLO_MESSAGE_CHECKPOINT_REQUEST, |
125 | COLO_MESSAGE_CHECKPOINT_REPLY, |
126 | COLO_MESSAGE_VMSTATE_SEND, |
127 | COLO_MESSAGE_VMSTATE_SIZE, |
128 | COLO_MESSAGE_VMSTATE_RECEIVED, |
129 | COLO_MESSAGE_VMSTATE_LOADED, |
130 | COLO_MESSAGE__MAX, |
131 | } COLOMessage; |
132 | |
133 | #define COLOMessage_str(val) \ |
134 | qapi_enum_lookup(&COLOMessage_lookup, (val)) |
135 | |
136 | extern const QEnumLookup COLOMessage_lookup; |
137 | |
138 | typedef enum COLOMode { |
139 | COLO_MODE_NONE, |
140 | COLO_MODE_PRIMARY, |
141 | COLO_MODE_SECONDARY, |
142 | COLO_MODE__MAX, |
143 | } COLOMode; |
144 | |
145 | #define COLOMode_str(val) \ |
146 | qapi_enum_lookup(&COLOMode_lookup, (val)) |
147 | |
148 | extern const QEnumLookup COLOMode_lookup; |
149 | |
150 | typedef enum FailoverStatus { |
151 | FAILOVER_STATUS_NONE, |
152 | FAILOVER_STATUS_REQUIRE, |
153 | FAILOVER_STATUS_ACTIVE, |
154 | FAILOVER_STATUS_COMPLETED, |
155 | FAILOVER_STATUS_RELAUNCH, |
156 | FAILOVER_STATUS__MAX, |
157 | } FailoverStatus; |
158 | |
159 | #define FailoverStatus_str(val) \ |
160 | qapi_enum_lookup(&FailoverStatus_lookup, (val)) |
161 | |
162 | extern const QEnumLookup FailoverStatus_lookup; |
163 | |
164 | typedef struct q_obj_COLO_EXIT_arg q_obj_COLO_EXIT_arg; |
165 | |
166 | typedef enum COLOExitReason { |
167 | COLO_EXIT_REASON_NONE, |
168 | COLO_EXIT_REASON_REQUEST, |
169 | COLO_EXIT_REASON_ERROR, |
170 | COLO_EXIT_REASON_PROCESSING, |
171 | COLO_EXIT_REASON__MAX, |
172 | } COLOExitReason; |
173 | |
174 | #define COLOExitReason_str(val) \ |
175 | qapi_enum_lookup(&COLOExitReason_lookup, (val)) |
176 | |
177 | extern const QEnumLookup COLOExitReason_lookup; |
178 | |
179 | typedef struct q_obj_migrate_continue_arg q_obj_migrate_continue_arg; |
180 | |
181 | typedef struct q_obj_migrate_set_downtime_arg q_obj_migrate_set_downtime_arg; |
182 | |
183 | typedef struct q_obj_migrate_set_speed_arg q_obj_migrate_set_speed_arg; |
184 | |
185 | typedef struct q_obj_migrate_set_cache_size_arg q_obj_migrate_set_cache_size_arg; |
186 | |
187 | typedef struct q_obj_migrate_arg q_obj_migrate_arg; |
188 | |
189 | typedef struct q_obj_migrate_incoming_arg q_obj_migrate_incoming_arg; |
190 | |
191 | typedef struct q_obj_xen_save_devices_state_arg q_obj_xen_save_devices_state_arg; |
192 | |
193 | #if defined(CONFIG_REPLICATION) |
194 | typedef struct q_obj_xen_set_replication_arg q_obj_xen_set_replication_arg; |
195 | #endif /* defined(CONFIG_REPLICATION) */ |
196 | |
197 | #if defined(CONFIG_REPLICATION) |
198 | typedef struct ReplicationStatus ReplicationStatus; |
199 | #endif /* defined(CONFIG_REPLICATION) */ |
200 | |
201 | typedef struct COLOStatus COLOStatus; |
202 | |
203 | typedef struct q_obj_migrate_recover_arg q_obj_migrate_recover_arg; |
204 | |
205 | struct MigrationStats { |
206 | int64_t transferred; |
207 | int64_t remaining; |
208 | int64_t total; |
209 | int64_t duplicate; |
210 | int64_t skipped; |
211 | int64_t normal; |
212 | int64_t normal_bytes; |
213 | int64_t dirty_pages_rate; |
214 | double mbps; |
215 | int64_t dirty_sync_count; |
216 | int64_t postcopy_requests; |
217 | int64_t page_size; |
218 | uint64_t multifd_bytes; |
219 | uint64_t pages_per_second; |
220 | }; |
221 | |
222 | void qapi_free_MigrationStats(MigrationStats *obj); |
223 | |
224 | struct XBZRLECacheStats { |
225 | int64_t cache_size; |
226 | int64_t bytes; |
227 | int64_t pages; |
228 | int64_t cache_miss; |
229 | double cache_miss_rate; |
230 | int64_t overflow; |
231 | }; |
232 | |
233 | void qapi_free_XBZRLECacheStats(XBZRLECacheStats *obj); |
234 | |
235 | struct CompressionStats { |
236 | int64_t pages; |
237 | int64_t busy; |
238 | double busy_rate; |
239 | int64_t compressed_size; |
240 | double compression_rate; |
241 | }; |
242 | |
243 | void qapi_free_CompressionStats(CompressionStats *obj); |
244 | |
245 | struct MigrationInfo { |
246 | bool has_status; |
247 | MigrationStatus status; |
248 | bool has_ram; |
249 | MigrationStats *ram; |
250 | bool has_disk; |
251 | MigrationStats *disk; |
252 | bool has_xbzrle_cache; |
253 | XBZRLECacheStats *xbzrle_cache; |
254 | bool has_total_time; |
255 | int64_t total_time; |
256 | bool has_expected_downtime; |
257 | int64_t expected_downtime; |
258 | bool has_downtime; |
259 | int64_t downtime; |
260 | bool has_setup_time; |
261 | int64_t setup_time; |
262 | bool has_cpu_throttle_percentage; |
263 | int64_t cpu_throttle_percentage; |
264 | bool has_error_desc; |
265 | char *error_desc; |
266 | bool has_postcopy_blocktime; |
267 | uint32_t postcopy_blocktime; |
268 | bool has_postcopy_vcpu_blocktime; |
269 | uint32List *postcopy_vcpu_blocktime; |
270 | bool has_compression; |
271 | CompressionStats *compression; |
272 | bool has_socket_address; |
273 | SocketAddressList *socket_address; |
274 | }; |
275 | |
276 | void qapi_free_MigrationInfo(MigrationInfo *obj); |
277 | |
278 | struct MigrationCapabilityStatus { |
279 | MigrationCapability capability; |
280 | bool state; |
281 | }; |
282 | |
283 | void qapi_free_MigrationCapabilityStatus(MigrationCapabilityStatus *obj); |
284 | |
285 | struct MigrationCapabilityStatusList { |
286 | MigrationCapabilityStatusList *next; |
287 | MigrationCapabilityStatus *value; |
288 | }; |
289 | |
290 | void qapi_free_MigrationCapabilityStatusList(MigrationCapabilityStatusList *obj); |
291 | |
292 | struct q_obj_migrate_set_capabilities_arg { |
293 | MigrationCapabilityStatusList *capabilities; |
294 | }; |
295 | |
296 | struct MigrateSetParameters { |
297 | bool has_announce_initial; |
298 | uint64_t announce_initial; |
299 | bool has_announce_max; |
300 | uint64_t announce_max; |
301 | bool has_announce_rounds; |
302 | uint64_t announce_rounds; |
303 | bool has_announce_step; |
304 | uint64_t announce_step; |
305 | bool has_compress_level; |
306 | int64_t compress_level; |
307 | bool has_compress_threads; |
308 | int64_t compress_threads; |
309 | bool has_compress_wait_thread; |
310 | bool compress_wait_thread; |
311 | bool has_decompress_threads; |
312 | int64_t decompress_threads; |
313 | bool has_cpu_throttle_initial; |
314 | int64_t cpu_throttle_initial; |
315 | bool has_cpu_throttle_increment; |
316 | int64_t cpu_throttle_increment; |
317 | bool has_tls_creds; |
318 | StrOrNull *tls_creds; |
319 | bool has_tls_hostname; |
320 | StrOrNull *tls_hostname; |
321 | bool has_tls_authz; |
322 | StrOrNull *tls_authz; |
323 | bool has_max_bandwidth; |
324 | int64_t max_bandwidth; |
325 | bool has_downtime_limit; |
326 | int64_t downtime_limit; |
327 | bool has_x_checkpoint_delay; |
328 | int64_t x_checkpoint_delay; |
329 | bool has_block_incremental; |
330 | bool block_incremental; |
331 | bool has_multifd_channels; |
332 | int64_t multifd_channels; |
333 | bool has_xbzrle_cache_size; |
334 | uint64_t xbzrle_cache_size; |
335 | bool has_max_postcopy_bandwidth; |
336 | uint64_t max_postcopy_bandwidth; |
337 | bool has_max_cpu_throttle; |
338 | int64_t max_cpu_throttle; |
339 | }; |
340 | |
341 | void qapi_free_MigrateSetParameters(MigrateSetParameters *obj); |
342 | |
343 | struct MigrationParameters { |
344 | bool has_announce_initial; |
345 | uint64_t announce_initial; |
346 | bool has_announce_max; |
347 | uint64_t announce_max; |
348 | bool has_announce_rounds; |
349 | uint64_t announce_rounds; |
350 | bool has_announce_step; |
351 | uint64_t announce_step; |
352 | bool has_compress_level; |
353 | uint8_t compress_level; |
354 | bool has_compress_threads; |
355 | uint8_t compress_threads; |
356 | bool has_compress_wait_thread; |
357 | bool compress_wait_thread; |
358 | bool has_decompress_threads; |
359 | uint8_t decompress_threads; |
360 | bool has_cpu_throttle_initial; |
361 | uint8_t cpu_throttle_initial; |
362 | bool has_cpu_throttle_increment; |
363 | uint8_t cpu_throttle_increment; |
364 | bool has_tls_creds; |
365 | char *tls_creds; |
366 | bool has_tls_hostname; |
367 | char *tls_hostname; |
368 | bool has_tls_authz; |
369 | char *tls_authz; |
370 | bool has_max_bandwidth; |
371 | uint64_t max_bandwidth; |
372 | bool has_downtime_limit; |
373 | uint64_t downtime_limit; |
374 | bool has_x_checkpoint_delay; |
375 | uint32_t x_checkpoint_delay; |
376 | bool has_block_incremental; |
377 | bool block_incremental; |
378 | bool has_multifd_channels; |
379 | uint8_t multifd_channels; |
380 | bool has_xbzrle_cache_size; |
381 | uint64_t xbzrle_cache_size; |
382 | bool has_max_postcopy_bandwidth; |
383 | uint64_t max_postcopy_bandwidth; |
384 | bool has_max_cpu_throttle; |
385 | uint8_t max_cpu_throttle; |
386 | }; |
387 | |
388 | void qapi_free_MigrationParameters(MigrationParameters *obj); |
389 | |
390 | struct q_obj_client_migrate_info_arg { |
391 | char *protocol; |
392 | char *hostname; |
393 | bool has_port; |
394 | int64_t port; |
395 | bool has_tls_port; |
396 | int64_t tls_port; |
397 | bool has_cert_subject; |
398 | char *cert_subject; |
399 | }; |
400 | |
401 | struct q_obj_MIGRATION_arg { |
402 | MigrationStatus status; |
403 | }; |
404 | |
405 | struct q_obj_MIGRATION_PASS_arg { |
406 | int64_t pass; |
407 | }; |
408 | |
409 | struct q_obj_COLO_EXIT_arg { |
410 | COLOMode mode; |
411 | COLOExitReason reason; |
412 | }; |
413 | |
414 | struct q_obj_migrate_continue_arg { |
415 | MigrationStatus state; |
416 | }; |
417 | |
418 | struct q_obj_migrate_set_downtime_arg { |
419 | double value; |
420 | }; |
421 | |
422 | struct q_obj_migrate_set_speed_arg { |
423 | int64_t value; |
424 | }; |
425 | |
426 | struct q_obj_migrate_set_cache_size_arg { |
427 | int64_t value; |
428 | }; |
429 | |
430 | struct q_obj_migrate_arg { |
431 | char *uri; |
432 | bool has_blk; |
433 | bool blk; |
434 | bool has_inc; |
435 | bool inc; |
436 | bool has_detach; |
437 | bool detach; |
438 | bool has_resume; |
439 | bool resume; |
440 | }; |
441 | |
442 | struct q_obj_migrate_incoming_arg { |
443 | char *uri; |
444 | }; |
445 | |
446 | struct q_obj_xen_save_devices_state_arg { |
447 | char *filename; |
448 | bool has_live; |
449 | bool live; |
450 | }; |
451 | |
452 | #if defined(CONFIG_REPLICATION) |
453 | struct q_obj_xen_set_replication_arg { |
454 | bool enable; |
455 | bool primary; |
456 | bool has_failover; |
457 | bool failover; |
458 | }; |
459 | #endif /* defined(CONFIG_REPLICATION) */ |
460 | |
461 | #if defined(CONFIG_REPLICATION) |
462 | struct ReplicationStatus { |
463 | bool error; |
464 | bool has_desc; |
465 | char *desc; |
466 | }; |
467 | #endif /* defined(CONFIG_REPLICATION) */ |
468 | |
469 | #if defined(CONFIG_REPLICATION) |
470 | void qapi_free_ReplicationStatus(ReplicationStatus *obj); |
471 | #endif /* defined(CONFIG_REPLICATION) */ |
472 | |
473 | struct COLOStatus { |
474 | COLOMode mode; |
475 | COLOMode last_mode; |
476 | COLOExitReason reason; |
477 | }; |
478 | |
479 | void qapi_free_COLOStatus(COLOStatus *obj); |
480 | |
481 | struct q_obj_migrate_recover_arg { |
482 | char *uri; |
483 | }; |
484 | |
485 | #endif /* QAPI_TYPES_MIGRATION_H */ |
486 | |