xref: /openbmc/qemu/migration/options.h (revision 51e47cf8)
1 /*
2  * QEMU migration capabilities
3  *
4  * Copyright (c) 2012-2023 Red Hat Inc
5  *
6  * Authors:
7  *   Orit Wasserman <owasserm@redhat.com>
8  *   Juan Quintela <quintela@redhat.com>
9  *
10  * This work is licensed under the terms of the GNU GPL, version 2 or later.
11  * See the COPYING file in the top-level directory.
12  */
13 
14 #ifndef QEMU_MIGRATION_OPTIONS_H
15 #define QEMU_MIGRATION_OPTIONS_H
16 
17 #include "hw/qdev-properties.h"
18 #include "hw/qdev-properties-system.h"
19 
20 /* constants */
21 
22 /* Amount of time to allocate to each "chunk" of bandwidth-throttled
23  * data. */
24 #define BUFFER_DELAY     100
25 #define XFER_LIMIT_RATIO (1000 / BUFFER_DELAY)
26 
27 /* migration properties */
28 
29 extern Property migration_properties[];
30 
31 /* capabilities */
32 
33 bool migrate_auto_converge(void);
34 bool migrate_background_snapshot(void);
35 bool migrate_block(void);
36 bool migrate_colo(void);
37 bool migrate_compress(void);
38 bool migrate_dirty_bitmaps(void);
39 bool migrate_events(void);
40 bool migrate_ignore_shared(void);
41 bool migrate_late_block_activate(void);
42 bool migrate_multifd(void);
43 bool migrate_pause_before_switchover(void);
44 bool migrate_postcopy_blocktime(void);
45 bool migrate_postcopy_preempt(void);
46 bool migrate_postcopy_ram(void);
47 bool migrate_rdma_pin_all(void);
48 bool migrate_release_ram(void);
49 bool migrate_return_path(void);
50 bool migrate_validate_uuid(void);
51 bool migrate_xbzrle(void);
52 bool migrate_zero_blocks(void);
53 bool migrate_zero_copy_send(void);
54 
55 /*
56  * pseudo capabilities
57  *
58  * These are functions that are used in a similar way to capabilities
59  * check, but they are not a capability.
60  */
61 
62 bool migrate_multifd_flush_after_each_section(void);
63 bool migrate_postcopy(void);
64 bool migrate_tls(void);
65 
66 /* capabilities helpers */
67 
68 bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp);
69 bool migrate_cap_set(int cap, bool value, Error **errp);
70 
71 /* parameters */
72 
73 const BitmapMigrationNodeAliasList *migrate_block_bitmap_mapping(void);
74 bool migrate_has_block_bitmap_mapping(void);
75 
76 bool migrate_block_incremental(void);
77 uint32_t migrate_checkpoint_delay(void);
78 int migrate_compress_level(void);
79 int migrate_compress_threads(void);
80 int migrate_compress_wait_thread(void);
81 uint8_t migrate_cpu_throttle_increment(void);
82 uint8_t migrate_cpu_throttle_initial(void);
83 bool migrate_cpu_throttle_tailslow(void);
84 int migrate_decompress_threads(void);
85 uint64_t migrate_downtime_limit(void);
86 uint8_t migrate_max_cpu_throttle(void);
87 uint64_t migrate_max_bandwidth(void);
88 uint64_t migrate_max_postcopy_bandwidth(void);
89 int migrate_multifd_channels(void);
90 MultiFDCompression migrate_multifd_compression(void);
91 int migrate_multifd_zlib_level(void);
92 int migrate_multifd_zstd_level(void);
93 uint8_t migrate_throttle_trigger_threshold(void);
94 const char *migrate_tls_authz(void);
95 const char *migrate_tls_creds(void);
96 const char *migrate_tls_hostname(void);
97 uint64_t migrate_xbzrle_cache_size(void);
98 
99 /* parameters setters */
100 
101 void migrate_set_block_incremental(bool value);
102 
103 /* parameters helpers */
104 
105 bool migrate_params_check(MigrationParameters *params, Error **errp);
106 void migrate_params_init(MigrationParameters *params);
107 void block_cleanup_parameters(void);
108 
109 #endif
110