zhanghailiang | 35a6ed4 | 2016-10-27 14:42:52 +0800 | [diff] [blame] | 1 | /* |
| 2 | * COarse-grain LOck-stepping Virtual Machines for Non-stop Service (COLO) |
| 3 | * (a.k.a. Fault Tolerance or Continuous Replication) |
| 4 | * |
| 5 | * Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD. |
| 6 | * Copyright (c) 2016 FUJITSU LIMITED |
| 7 | * Copyright (c) 2016 Intel Corporation |
| 8 | * |
| 9 | * This work is licensed under the terms of the GNU GPL, version 2 or |
| 10 | * later. See the COPYING file in the top-level directory. |
| 11 | */ |
| 12 | |
| 13 | #ifndef QEMU_COLO_H |
| 14 | #define QEMU_COLO_H |
| 15 | |
| 16 | #include "qemu-common.h" |
Markus Armbruster | 9af2398 | 2018-02-11 10:36:01 +0100 | [diff] [blame] | 17 | #include "qapi/qapi-types-migration.h" |
zhanghailiang | 35a6ed4 | 2016-10-27 14:42:52 +0800 | [diff] [blame] | 18 | |
Zhang Chen | 0ffcece | 2018-09-03 12:38:43 +0800 | [diff] [blame] | 19 | enum colo_event { |
| 20 | COLO_EVENT_NONE, |
| 21 | COLO_EVENT_CHECKPOINT, |
| 22 | COLO_EVENT_FAILOVER, |
| 23 | }; |
| 24 | |
zhanghailiang | 5821ebf | 2016-10-27 14:42:53 +0800 | [diff] [blame] | 25 | void colo_info_init(void); |
zhanghailiang | 35a6ed4 | 2016-10-27 14:42:52 +0800 | [diff] [blame] | 26 | |
zhanghailiang | 0b827d5 | 2016-10-27 14:42:54 +0800 | [diff] [blame] | 27 | void migrate_start_colo_process(MigrationState *s); |
| 28 | bool migration_in_colo_state(void); |
| 29 | |
zhanghailiang | 25d0c16 | 2016-10-27 14:42:55 +0800 | [diff] [blame] | 30 | /* loadvm */ |
Zhang Chen | aad555c | 2018-09-03 12:38:47 +0800 | [diff] [blame] | 31 | void migration_incoming_enable_colo(void); |
| 32 | void migration_incoming_disable_colo(void); |
| 33 | bool migration_incoming_colo_enabled(void); |
zhanghailiang | 25d0c16 | 2016-10-27 14:42:55 +0800 | [diff] [blame] | 34 | void *colo_process_incoming_thread(void *opaque); |
| 35 | bool migration_incoming_in_colo_state(void); |
zhanghailiang | d89e666 | 2016-10-27 14:43:03 +0800 | [diff] [blame] | 36 | |
| 37 | COLOMode get_colo_mode(void); |
zhanghailiang | b3f7f0c | 2016-10-27 14:43:05 +0800 | [diff] [blame] | 38 | |
| 39 | /* failover */ |
| 40 | void colo_do_failover(MigrationState *s); |
zhanghailiang | 479125d | 2017-01-17 20:57:42 +0800 | [diff] [blame] | 41 | |
| 42 | void colo_checkpoint_notify(void *opaque); |
zhanghailiang | 35a6ed4 | 2016-10-27 14:42:52 +0800 | [diff] [blame] | 43 | #endif |