aboutsummaryrefslogtreecommitdiff
path: root/migration/colo-comm.c
diff options
context:
space:
mode:
Diffstat (limited to 'migration/colo-comm.c')
-rw-r--r--migration/colo-comm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/migration/colo-comm.c b/migration/colo-comm.c
index bf44f76440..20b60ec384 100644
--- a/migration/colo-comm.c
+++ b/migration/colo-comm.c
@@ -21,6 +21,17 @@ typedef struct {
static COLOInfo colo_info;
+COLOMode get_colo_mode(void)
+{
+ if (migration_in_colo_state()) {
+ return COLO_MODE_PRIMARY;
+ } else if (migration_incoming_in_colo_state()) {
+ return COLO_MODE_SECONDARY;
+ } else {
+ return COLO_MODE_UNKNOWN;
+ }
+}
+
static void colo_info_pre_save(void *opaque)
{
COLOInfo *s = opaque;