blob: 99ce17aca774d2997ad2575920b5a338a4a55f95 [file] [log] [blame]
zhanghailiang35a6ed42016-10-27 14:42:52 +08001/*
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 Armbruster9af23982018-02-11 10:36:01 +010017#include "qapi/qapi-types-migration.h"
zhanghailiang35a6ed42016-10-27 14:42:52 +080018
Zhang Chen0ffcece2018-09-03 12:38:43 +080019enum colo_event {
20 COLO_EVENT_NONE,
21 COLO_EVENT_CHECKPOINT,
22 COLO_EVENT_FAILOVER,
23};
24
zhanghailiang5821ebf2016-10-27 14:42:53 +080025void colo_info_init(void);
zhanghailiang35a6ed42016-10-27 14:42:52 +080026
zhanghailiang0b827d52016-10-27 14:42:54 +080027void migrate_start_colo_process(MigrationState *s);
28bool migration_in_colo_state(void);
29
zhanghailiang25d0c162016-10-27 14:42:55 +080030/* loadvm */
Zhang Chenaad555c2018-09-03 12:38:47 +080031void migration_incoming_enable_colo(void);
32void migration_incoming_disable_colo(void);
33bool migration_incoming_colo_enabled(void);
zhanghailiang25d0c162016-10-27 14:42:55 +080034void *colo_process_incoming_thread(void *opaque);
35bool migration_incoming_in_colo_state(void);
zhanghailiangd89e6662016-10-27 14:43:03 +080036
37COLOMode get_colo_mode(void);
zhanghailiangb3f7f0c2016-10-27 14:43:05 +080038
39/* failover */
40void colo_do_failover(MigrationState *s);
zhanghailiang479125d2017-01-17 20:57:42 +080041
42void colo_checkpoint_notify(void *opaque);
zhanghailiang35a6ed42016-10-27 14:42:52 +080043#endif