aliguori | 5bb7910 | 2008-10-13 03:12:02 +0000 | [diff] [blame] | 1 | /* |
| 2 | * QEMU live migration |
| 3 | * |
| 4 | * Copyright IBM, Corp. 2008 |
| 5 | * |
| 6 | * Authors: |
| 7 | * Anthony Liguori <aliguori@us.ibm.com> |
| 8 | * |
| 9 | * This work is licensed under the terms of the GNU GPL, version 2. See |
| 10 | * the COPYING file in the top-level directory. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #ifndef QEMU_MIGRATION_H |
| 15 | #define QEMU_MIGRATION_H |
| 16 | |
aliguori | 376253e | 2009-03-05 23:01:23 +0000 | [diff] [blame] | 17 | #include "qemu-common.h" |
Markus Armbruster | 9af2398 | 2018-02-11 10:36:01 +0100 | [diff] [blame] | 18 | #include "qapi/qapi-types-migration.h" |
Juan Quintela | 9848a40 | 2012-12-19 09:55:50 +0100 | [diff] [blame] | 19 | #include "qemu/thread.h" |
Michael R. Hines | 43487c6 | 2013-06-25 21:35:35 -0400 | [diff] [blame] | 20 | #include "exec/cpu-common.h" |
zhanghailiang | 25d0c16 | 2016-10-27 14:42:55 +0800 | [diff] [blame] | 21 | #include "qemu/coroutine_int.h" |
Peter Xu | e5cb7e7 | 2017-06-27 12:10:13 +0800 | [diff] [blame] | 22 | #include "hw/qdev.h" |
Juan Quintela | 4f0fae7 | 2017-07-24 12:42:02 +0200 | [diff] [blame] | 23 | #include "io/channel.h" |
aliguori | 376253e | 2009-03-05 23:01:23 +0000 | [diff] [blame] | 24 | |
Alexey Perevalov | 2a4c42f | 2018-03-22 21:17:23 +0300 | [diff] [blame] | 25 | struct PostcopyBlocktimeContext; |
| 26 | |
Peter Xu | 13955b8 | 2018-05-02 18:47:30 +0800 | [diff] [blame] | 27 | #define MIGRATION_RESUME_ACK_VALUE (1) |
| 28 | |
Dr. David Alan Gilbert | bca7856 | 2015-05-21 13:24:14 +0100 | [diff] [blame] | 29 | /* State for the incoming migration */ |
| 30 | struct MigrationIncomingState { |
Dr. David Alan Gilbert | 42e2aa5 | 2015-11-05 18:10:34 +0000 | [diff] [blame] | 31 | QEMUFile *from_src_file; |
Dr. David Alan Gilbert | 1a8f46f | 2015-05-21 13:24:16 +0100 | [diff] [blame] | 32 | |
Dr. David Alan Gilbert | 7b89bf2 | 2015-11-05 18:10:50 +0000 | [diff] [blame] | 33 | /* |
| 34 | * Free at the start of the main state load, set as the main thread finishes |
| 35 | * loading state. |
| 36 | */ |
| 37 | QemuEvent main_thread_load_event; |
| 38 | |
Dr. David Alan Gilbert | 67f11b5 | 2017-02-24 18:28:34 +0000 | [diff] [blame] | 39 | size_t largest_page_size; |
Dr. David Alan Gilbert | c4faeed | 2015-11-05 18:11:17 +0000 | [diff] [blame] | 40 | bool have_fault_thread; |
Dr. David Alan Gilbert | f0a227a | 2015-11-05 18:11:04 +0000 | [diff] [blame] | 41 | QemuThread fault_thread; |
| 42 | QemuSemaphore fault_thread_sem; |
Peter Xu | 64f615f | 2018-02-08 18:31:06 +0800 | [diff] [blame] | 43 | /* Set this when we want the fault thread to quit */ |
| 44 | bool fault_thread_quit; |
Dr. David Alan Gilbert | f0a227a | 2015-11-05 18:11:04 +0000 | [diff] [blame] | 45 | |
Dr. David Alan Gilbert | c76201a | 2015-11-05 18:11:18 +0000 | [diff] [blame] | 46 | bool have_listen_thread; |
| 47 | QemuThread listen_thread; |
| 48 | QemuSemaphore listen_thread_sem; |
| 49 | |
Dr. David Alan Gilbert | 1caddf8 | 2015-11-05 18:11:03 +0000 | [diff] [blame] | 50 | /* For the kernel to send us notifications */ |
| 51 | int userfault_fd; |
Peter Xu | 64f615f | 2018-02-08 18:31:06 +0800 | [diff] [blame] | 52 | /* To notify the fault_thread to wake, e.g., when need to quit */ |
| 53 | int userfault_event_fd; |
Dr. David Alan Gilbert | 2e37701 | 2015-11-05 18:10:46 +0000 | [diff] [blame] | 54 | QEMUFile *to_src_file; |
Dr. David Alan Gilbert | 6decec9 | 2015-11-05 18:10:47 +0000 | [diff] [blame] | 55 | QemuMutex rp_mutex; /* We send replies from multiple threads */ |
Dr. David Alan Gilbert | 096bf4c | 2018-03-12 17:21:12 +0000 | [diff] [blame] | 56 | /* RAMBlock of last request sent to source */ |
| 57 | RAMBlock *last_rb; |
Dr. David Alan Gilbert | 696ed9a | 2015-11-05 18:11:10 +0000 | [diff] [blame] | 58 | void *postcopy_tmp_page; |
Dr. David Alan Gilbert | 41d8421 | 2017-02-24 18:28:36 +0000 | [diff] [blame] | 59 | void *postcopy_tmp_zero_page; |
Dr. David Alan Gilbert | 00fa4fc | 2018-03-12 17:21:04 +0000 | [diff] [blame] | 60 | /* PostCopyFD's for external userfaultfds & handlers of shared memory */ |
| 61 | GArray *postcopy_remote_fds; |
Dr. David Alan Gilbert | 2e37701 | 2015-11-05 18:10:46 +0000 | [diff] [blame] | 62 | |
Denis V. Lunev | 0aa6aef | 2016-02-24 11:53:38 +0300 | [diff] [blame] | 63 | QEMUBH *bh; |
| 64 | |
zhanghailiang | 93d7af6 | 2015-12-16 11:47:34 +0000 | [diff] [blame] | 65 | int state; |
zhanghailiang | 25d0c16 | 2016-10-27 14:42:55 +0800 | [diff] [blame] | 66 | |
| 67 | bool have_colo_incoming_thread; |
| 68 | QemuThread colo_incoming_thread; |
| 69 | /* The coroutine we should enter (back) after failover */ |
| 70 | Coroutine *migration_incoming_co; |
zhanghailiang | c937b9a | 2017-01-17 20:57:43 +0800 | [diff] [blame] | 71 | QemuSemaphore colo_incoming_sem; |
Alexey Perevalov | 2a4c42f | 2018-03-22 21:17:23 +0300 | [diff] [blame] | 72 | |
| 73 | /* |
| 74 | * PostcopyBlocktimeContext to keep information for postcopy |
| 75 | * live migration, to calculate vCPU block time |
| 76 | * */ |
| 77 | struct PostcopyBlocktimeContext *blocktime_ctx; |
Peter Xu | b411b84 | 2018-05-02 18:47:20 +0800 | [diff] [blame] | 78 | |
| 79 | /* notify PAUSED postcopy incoming migrations to try to continue */ |
Peter Xu | 02affd4 | 2018-05-02 18:47:36 +0800 | [diff] [blame] | 80 | bool postcopy_recover_triggered; |
Peter Xu | b411b84 | 2018-05-02 18:47:20 +0800 | [diff] [blame] | 81 | QemuSemaphore postcopy_pause_sem_dst; |
Peter Xu | 3a7804c | 2018-05-02 18:47:22 +0800 | [diff] [blame] | 82 | QemuSemaphore postcopy_pause_sem_fault; |
Dr. David Alan Gilbert | bca7856 | 2015-05-21 13:24:14 +0100 | [diff] [blame] | 83 | }; |
| 84 | |
| 85 | MigrationIncomingState *migration_incoming_get_current(void); |
Dr. David Alan Gilbert | bca7856 | 2015-05-21 13:24:14 +0100 | [diff] [blame] | 86 | void migration_incoming_state_destroy(void); |
Alexey Perevalov | 65ace06 | 2018-03-22 21:17:27 +0300 | [diff] [blame] | 87 | /* |
| 88 | * Functions to work with blocktime context |
| 89 | */ |
| 90 | void fill_destination_postcopy_migration_info(MigrationInfo *info); |
Dr. David Alan Gilbert | bca7856 | 2015-05-21 13:24:14 +0100 | [diff] [blame] | 91 | |
Peter Xu | e5cb7e7 | 2017-06-27 12:10:13 +0800 | [diff] [blame] | 92 | #define TYPE_MIGRATION "migration" |
| 93 | |
| 94 | #define MIGRATION_CLASS(klass) \ |
| 95 | OBJECT_CLASS_CHECK(MigrationClass, (klass), TYPE_MIGRATION) |
| 96 | #define MIGRATION_OBJ(obj) \ |
| 97 | OBJECT_CHECK(MigrationState, (obj), TYPE_MIGRATION) |
| 98 | #define MIGRATION_GET_CLASS(obj) \ |
| 99 | OBJECT_GET_CLASS(MigrationClass, (obj), TYPE_MIGRATION) |
| 100 | |
| 101 | typedef struct MigrationClass { |
| 102 | /*< private >*/ |
| 103 | DeviceClass parent_class; |
| 104 | } MigrationClass; |
| 105 | |
Juan Quintela | 22f00a4 | 2010-05-11 15:56:35 +0200 | [diff] [blame] | 106 | struct MigrationState |
aliguori | 065e281 | 2008-11-11 16:46:33 +0000 | [diff] [blame] | 107 | { |
Peter Xu | e5cb7e7 | 2017-06-27 12:10:13 +0800 | [diff] [blame] | 108 | /*< private >*/ |
| 109 | DeviceState parent_obj; |
| 110 | |
| 111 | /*< public >*/ |
Juan Quintela | 9848a40 | 2012-12-19 09:55:50 +0100 | [diff] [blame] | 112 | size_t bytes_xfer; |
| 113 | size_t xfer_limit; |
Juan Quintela | 9848a40 | 2012-12-19 09:55:50 +0100 | [diff] [blame] | 114 | QemuThread thread; |
Paolo Bonzini | bb1fadc | 2013-02-22 17:36:21 +0100 | [diff] [blame] | 115 | QEMUBH *cleanup_bh; |
zhanghailiang | 89a02a9 | 2016-01-15 11:37:42 +0800 | [diff] [blame] | 116 | QEMUFile *to_dst_file; |
Peter Xu | 62df066 | 2018-05-02 18:47:38 +0800 | [diff] [blame] | 117 | /* |
| 118 | * Protects to_dst_file pointer. We need to make sure we won't |
| 119 | * yield or hang during the critical section, since this lock will |
| 120 | * be used in OOB command handler. |
| 121 | */ |
| 122 | QemuMutex qemu_file_lock; |
Daniel P. Berrange | 2594f56 | 2016-04-27 11:05:14 +0100 | [diff] [blame] | 123 | |
Dr. David Alan Gilbert | ad767be | 2018-06-13 11:26:41 +0100 | [diff] [blame] | 124 | /* |
| 125 | * Used to allow urgent requests to override rate limiting. |
| 126 | */ |
| 127 | QemuSemaphore rate_limit_sem; |
| 128 | |
Peter Xu | b15df1a | 2018-01-03 20:20:13 +0800 | [diff] [blame] | 129 | /* bytes already send at the beggining of current interation */ |
| 130 | uint64_t iteration_initial_bytes; |
| 131 | /* time at the start of current iteration */ |
| 132 | int64_t iteration_start_time; |
| 133 | /* |
| 134 | * The final stage happens when the remaining data is smaller than |
| 135 | * this threshold; it's calculated from the requested downtime and |
| 136 | * measured bandwidth |
| 137 | */ |
| 138 | int64_t threshold_size; |
| 139 | |
Juan Quintela | a0762d9 | 2017-04-05 21:00:09 +0200 | [diff] [blame] | 140 | /* params from 'migrate-set-parameters' */ |
Daniel P. Berrange | 2594f56 | 2016-04-27 11:05:14 +0100 | [diff] [blame] | 141 | MigrationParameters parameters; |
Paolo Bonzini | f8bbc12 | 2013-02-22 17:36:41 +0100 | [diff] [blame] | 142 | |
Paolo Bonzini | f8bbc12 | 2013-02-22 17:36:41 +0100 | [diff] [blame] | 143 | int state; |
Dr. David Alan Gilbert | 70b2047 | 2015-11-05 18:10:49 +0000 | [diff] [blame] | 144 | |
| 145 | /* State related to return path */ |
| 146 | struct { |
| 147 | QEMUFile *from_dst_file; |
| 148 | QemuThread rp_thread; |
| 149 | bool error; |
Peter Xu | edd090c | 2018-05-02 18:47:32 +0800 | [diff] [blame] | 150 | QemuSemaphore rp_sem; |
Dr. David Alan Gilbert | 70b2047 | 2015-11-05 18:10:49 +0000 | [diff] [blame] | 151 | } rp_state; |
| 152 | |
Michael R. Hines | 7e114f8 | 2013-06-25 21:35:30 -0400 | [diff] [blame] | 153 | double mbps; |
Peter Xu | 4af246a | 2018-01-03 20:20:08 +0800 | [diff] [blame] | 154 | /* Timestamp when recent migration starts (ms) */ |
| 155 | int64_t start_time; |
| 156 | /* Total time used by latest migration (ms) */ |
Juan Quintela | d5f8a57 | 2012-05-21 22:01:07 +0200 | [diff] [blame] | 157 | int64_t total_time; |
Peter Xu | 64909f9 | 2018-01-03 20:20:10 +0800 | [diff] [blame] | 158 | /* Timestamp when VM is down (ms) to migrate the last stuff */ |
| 159 | int64_t downtime_start; |
Juan Quintela | 9c5a9fc | 2012-08-13 09:35:16 +0200 | [diff] [blame] | 160 | int64_t downtime; |
Juan Quintela | 2c52ddf | 2012-08-13 09:53:12 +0200 | [diff] [blame] | 161 | int64_t expected_downtime; |
Eric Blake | 7fb1cf1 | 2015-11-18 01:52:57 -0700 | [diff] [blame] | 162 | bool enabled_capabilities[MIGRATION_CAPABILITY__MAX]; |
Michael R. Hines | ed4fbd1 | 2013-07-22 10:01:58 -0400 | [diff] [blame] | 163 | int64_t setup_time; |
Peter Xu | 7287cbd | 2018-01-03 20:20:09 +0800 | [diff] [blame] | 164 | /* |
| 165 | * Whether guest was running when we enter the completion stage. |
| 166 | * If migration is interrupted by any reason, we need to continue |
| 167 | * running the guest on source. |
| 168 | */ |
| 169 | bool vm_was_running; |
Dr. David Alan Gilbert | 4886a1b | 2015-11-05 18:10:56 +0000 | [diff] [blame] | 170 | |
| 171 | /* Flag set once the migration has been asked to enter postcopy */ |
| 172 | bool start_postcopy; |
Dr. David Alan Gilbert | b82fc32 | 2016-02-22 17:17:32 +0000 | [diff] [blame] | 173 | /* Flag set after postcopy has sent the device state */ |
| 174 | bool postcopy_after_devices; |
Dr. David Alan Gilbert | 1d34e4b | 2015-11-05 18:11:05 +0000 | [diff] [blame] | 175 | |
| 176 | /* Flag set once the migration thread is running (and needs joining) */ |
| 177 | bool migration_thread_running; |
Dr. David Alan Gilbert | 6c595cd | 2015-11-05 18:11:08 +0000 | [diff] [blame] | 178 | |
zhanghailiang | 1d2acc3 | 2017-01-24 15:59:52 +0800 | [diff] [blame] | 179 | /* Flag set once the migration thread called bdrv_inactivate_all */ |
| 180 | bool block_inactive; |
| 181 | |
Dr. David Alan Gilbert | e91d895 | 2017-10-20 10:05:52 +0100 | [diff] [blame] | 182 | /* Migration is paused due to pause-before-switchover */ |
| 183 | QemuSemaphore pause_sem; |
| 184 | |
zhanghailiang | c937b9a | 2017-01-17 20:57:43 +0800 | [diff] [blame] | 185 | /* The semaphore is used to notify COLO thread that failover is finished */ |
| 186 | QemuSemaphore colo_exit_sem; |
Daniel P. Berrange | d59ce6f | 2016-04-27 11:05:00 +0100 | [diff] [blame] | 187 | |
zhanghailiang | 479125d | 2017-01-17 20:57:42 +0800 | [diff] [blame] | 188 | /* The semaphore is used to notify COLO thread to do checkpoint */ |
| 189 | QemuSemaphore colo_checkpoint_sem; |
| 190 | int64_t colo_checkpoint_time; |
| 191 | QEMUTimer *colo_delay_timer; |
| 192 | |
Juan Quintela | 87db1a7 | 2017-09-05 12:50:22 +0200 | [diff] [blame] | 193 | /* The first error that has occurred. |
| 194 | We used the mutex to be able to return the 1st error message */ |
Daniel P. Berrange | d59ce6f | 2016-04-27 11:05:00 +0100 | [diff] [blame] | 195 | Error *error; |
Juan Quintela | 87db1a7 | 2017-09-05 12:50:22 +0200 | [diff] [blame] | 196 | /* mutex to protect errp */ |
| 197 | QemuMutex error_mutex; |
| 198 | |
Juan Quintela | 2833c59 | 2017-04-05 18:32:37 +0200 | [diff] [blame] | 199 | /* Do we have to clean up -b/-i from old migrate parameters */ |
| 200 | /* This feature is deprecated and will be removed */ |
| 201 | bool must_remove_block_options; |
Peter Xu | 5272298 | 2017-06-27 12:10:14 +0800 | [diff] [blame] | 202 | |
| 203 | /* |
| 204 | * Global switch on whether we need to store the global state |
| 205 | * during migration. |
| 206 | */ |
| 207 | bool store_global_state; |
Peter Xu | 3df663e | 2017-06-27 12:10:15 +0800 | [diff] [blame] | 208 | |
| 209 | /* Whether the VM is only allowing for migratable devices */ |
| 210 | bool only_migratable; |
Peter Xu | 71dd4c1 | 2017-06-27 12:10:16 +0800 | [diff] [blame] | 211 | |
| 212 | /* Whether we send QEMU_VM_CONFIGURATION during migration */ |
| 213 | bool send_configuration; |
Peter Xu | 15c3850 | 2017-06-27 12:10:17 +0800 | [diff] [blame] | 214 | /* Whether we send section footer during migration */ |
| 215 | bool send_section_footer; |
Peter Xu | b23c2ad | 2018-05-02 18:47:19 +0800 | [diff] [blame] | 216 | |
| 217 | /* Needed by postcopy-pause state */ |
| 218 | QemuSemaphore postcopy_pause_sem; |
Peter Xu | 14b1742 | 2018-05-02 18:47:21 +0800 | [diff] [blame] | 219 | QemuSemaphore postcopy_pause_rp_sem; |
Xiao Guangrong | f548222 | 2018-05-03 16:06:11 +0800 | [diff] [blame] | 220 | /* |
| 221 | * Whether we abort the migration if decompression errors are |
| 222 | * detected at the destination. It is left at false for qemu |
| 223 | * older than 3.0, since only newer qemu sends streams that |
| 224 | * do not trigger spurious decompression errors. |
| 225 | */ |
| 226 | bool decompress_error_check; |
aliguori | 065e281 | 2008-11-11 16:46:33 +0000 | [diff] [blame] | 227 | }; |
| 228 | |
zhanghailiang | 48781e5 | 2015-12-16 11:47:33 +0000 | [diff] [blame] | 229 | void migrate_set_state(int *state, int old_state, int new_state); |
| 230 | |
Daniel P. Berrange | 22724f4 | 2016-06-01 11:17:14 +0100 | [diff] [blame] | 231 | void migration_fd_process_incoming(QEMUFile *f); |
Juan Quintela | 4f0fae7 | 2017-07-24 12:42:02 +0200 | [diff] [blame] | 232 | void migration_ioc_process_incoming(QIOChannel *ioc); |
Juan Quintela | 36c2f8b | 2018-03-07 08:40:52 +0100 | [diff] [blame] | 233 | void migration_incoming_process(void); |
Juan Quintela | 511c023 | 2010-06-09 14:10:55 +0200 | [diff] [blame] | 234 | |
Juan Quintela | 428d890 | 2017-07-24 13:06:25 +0200 | [diff] [blame] | 235 | bool migration_has_all_channels(void); |
| 236 | |
Glauber Costa | a0a3fd6 | 2009-05-28 15:22:57 -0400 | [diff] [blame] | 237 | uint64_t migrate_max_downtime(void); |
| 238 | |
Juan Quintela | 87db1a7 | 2017-09-05 12:50:22 +0200 | [diff] [blame] | 239 | void migrate_set_error(MigrationState *s, const Error *error); |
Daniel P. Berrange | d59ce6f | 2016-04-27 11:05:00 +0100 | [diff] [blame] | 240 | void migrate_fd_error(MigrationState *s, const Error *error); |
aliguori | 065e281 | 2008-11-11 16:46:33 +0000 | [diff] [blame] | 241 | |
Dr. David Alan Gilbert | cce8040 | 2017-12-15 17:16:54 +0000 | [diff] [blame] | 242 | void migrate_fd_connect(MigrationState *s, Error *error_in); |
aliguori | 065e281 | 2008-11-11 16:46:33 +0000 | [diff] [blame] | 243 | |
Peter Xu | 3e0c805 | 2018-02-08 18:31:15 +0800 | [diff] [blame] | 244 | void migrate_init(MigrationState *s); |
Greg Kurz | 24f3902 | 2016-05-04 21:44:19 +0200 | [diff] [blame] | 245 | bool migration_is_blocked(Error **errp); |
Dr. David Alan Gilbert | 9ec055a | 2015-11-05 18:10:58 +0000 | [diff] [blame] | 246 | /* True if outgoing migration has entered postcopy phase */ |
Juan Quintela | 5727309 | 2017-03-20 22:25:28 +0100 | [diff] [blame] | 247 | bool migration_in_postcopy(void); |
Juan Quintela | 859bc75 | 2012-08-13 09:42:49 +0200 | [diff] [blame] | 248 | MigrationState *migrate_get_current(void); |
Gerd Hoffmann | 99a0db9 | 2010-12-13 17:30:12 +0100 | [diff] [blame] | 249 | |
Vladimir Sementsov-Ogievskiy | 58110f0 | 2017-07-10 19:30:16 +0300 | [diff] [blame] | 250 | bool migrate_postcopy(void); |
| 251 | |
Pavel Butsykin | 53f09a1 | 2017-02-03 18:23:20 +0300 | [diff] [blame] | 252 | bool migrate_release_ram(void); |
Dr. David Alan Gilbert | 53dd370 | 2015-11-05 18:10:51 +0000 | [diff] [blame] | 253 | bool migrate_postcopy_ram(void); |
Peter Lieven | 323004a | 2013-07-18 09:48:50 +0200 | [diff] [blame] | 254 | bool migrate_zero_blocks(void); |
Vladimir Sementsov-Ogievskiy | 55efc8c | 2018-03-13 15:34:00 -0400 | [diff] [blame] | 255 | bool migrate_dirty_bitmaps(void); |
Michael R. Hines | 60d9222 | 2013-06-25 21:35:36 -0400 | [diff] [blame] | 256 | |
Chegu Vinod | bde1e2e | 2013-06-24 03:49:42 -0600 | [diff] [blame] | 257 | bool migrate_auto_converge(void); |
Juan Quintela | 30126bb | 2016-01-14 12:23:00 +0100 | [diff] [blame] | 258 | bool migrate_use_multifd(void); |
Dr. David Alan Gilbert | 93fbd03 | 2017-10-20 10:05:50 +0100 | [diff] [blame] | 259 | bool migrate_pause_before_switchover(void); |
Juan Quintela | 4075fb1 | 2016-01-15 08:56:17 +0100 | [diff] [blame] | 260 | int migrate_multifd_channels(void); |
Juan Quintela | 0fb8660 | 2017-04-27 10:48:25 +0200 | [diff] [blame] | 261 | int migrate_multifd_page_count(void); |
Chegu Vinod | bde1e2e | 2013-06-24 03:49:42 -0600 | [diff] [blame] | 262 | |
Orit Wasserman | 17ad9b3 | 2012-08-06 21:42:53 +0300 | [diff] [blame] | 263 | int migrate_use_xbzrle(void); |
| 264 | int64_t migrate_xbzrle_cache_size(void); |
zhanghailiang | 35a6ed4 | 2016-10-27 14:42:52 +0800 | [diff] [blame] | 265 | bool migrate_colo_enabled(void); |
Orit Wasserman | 17ad9b3 | 2012-08-06 21:42:53 +0300 | [diff] [blame] | 266 | |
Juan Quintela | 2833c59 | 2017-04-05 18:32:37 +0200 | [diff] [blame] | 267 | bool migrate_use_block(void); |
| 268 | bool migrate_use_block_incremental(void); |
Peter Xu | c788ada | 2017-06-26 18:28:55 +0800 | [diff] [blame] | 269 | bool migrate_use_return_path(void); |
Juan Quintela | 2833c59 | 2017-04-05 18:32:37 +0200 | [diff] [blame] | 270 | |
Liang Li | 8706d2d | 2015-03-23 16:32:17 +0800 | [diff] [blame] | 271 | bool migrate_use_compression(void); |
| 272 | int migrate_compress_level(void); |
| 273 | int migrate_compress_threads(void); |
Liang Li | 3fcb38c | 2015-03-23 16:32:18 +0800 | [diff] [blame] | 274 | int migrate_decompress_threads(void); |
Juan Quintela | b05dc72 | 2015-07-07 14:44:05 +0200 | [diff] [blame] | 275 | bool migrate_use_events(void); |
Alexey Perevalov | f22f928 | 2018-03-22 21:17:22 +0300 | [diff] [blame] | 276 | bool migrate_postcopy_blocktime(void); |
Liang Li | 8706d2d | 2015-03-23 16:32:17 +0800 | [diff] [blame] | 277 | |
Dr. David Alan Gilbert | 6decec9 | 2015-11-05 18:10:47 +0000 | [diff] [blame] | 278 | /* Sending on the return path - generic and then for each message type */ |
Dr. David Alan Gilbert | 6decec9 | 2015-11-05 18:10:47 +0000 | [diff] [blame] | 279 | void migrate_send_rp_shut(MigrationIncomingState *mis, |
| 280 | uint32_t value); |
| 281 | void migrate_send_rp_pong(MigrationIncomingState *mis, |
| 282 | uint32_t value); |
Peter Xu | d6208e3 | 2018-02-08 18:31:12 +0800 | [diff] [blame] | 283 | int migrate_send_rp_req_pages(MigrationIncomingState *mis, const char* rbname, |
Dr. David Alan Gilbert | 1e2d90e | 2015-11-05 18:11:07 +0000 | [diff] [blame] | 284 | ram_addr_t start, size_t len); |
Peter Xu | a335deb | 2018-05-02 18:47:28 +0800 | [diff] [blame] | 285 | void migrate_send_rp_recv_bitmap(MigrationIncomingState *mis, |
| 286 | char *block_name); |
Peter Xu | 13955b8 | 2018-05-02 18:47:30 +0800 | [diff] [blame] | 287 | void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value); |
Dr. David Alan Gilbert | 6decec9 | 2015-11-05 18:10:47 +0000 | [diff] [blame] | 288 | |
Vladimir Sementsov-Ogievskiy | b35ebdf | 2018-03-13 15:34:01 -0400 | [diff] [blame] | 289 | void dirty_bitmap_mig_before_vm_start(void); |
| 290 | void init_dirty_bitmap_incoming_migration(void); |
| 291 | |
Dr. David Alan Gilbert | 343f632 | 2018-06-05 17:25:45 +0100 | [diff] [blame] | 292 | #define qemu_ram_foreach_block \ |
| 293 | #warning "Use qemu_ram_foreach_block_migratable in migration code" |
| 294 | |
Dr. David Alan Gilbert | ad767be | 2018-06-13 11:26:41 +0100 | [diff] [blame] | 295 | void migration_make_urgent_request(void); |
| 296 | void migration_consume_urgent_request(void); |
| 297 | |
aliguori | 5bb7910 | 2008-10-13 03:12:02 +0000 | [diff] [blame] | 298 | #endif |