Commit 35a6ed4f authored by zhanghailiang's avatar zhanghailiang Committed by Amit Shah
Browse files

migration: Introduce capability 'x-colo' to migration



We add helper function colo_supported() to indicate whether
colo is supported or not, with which we use to control whether or not
showing 'x-colo' string to users, they can use qmp command
'query-migrate-capabilities' or hmp command 'info migrate_capabilities'
to learn if colo is supported.

The default value for COLO (COarse-Grain LOck Stepping) is disabled.

Cc: Juan Quintela <quintela@redhat.com>
Cc: Amit Shah <amit.shah@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: default avatarzhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: default avatarLi Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: default avatarGonglei <arei.gonglei@huawei.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Reviewed-by: default avatarAmit Shah <amit.shah@redhat.com>
Signed-off-by: default avatarAmit Shah <amit@amitshah.net>
parent 5b2ecaba
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2861,6 +2861,7 @@ Enable/Disable migration capabilities
- "compress": use multiple compression threads to accelerate live migration
- "events": generate events for each migration state change
- "postcopy-ram": postcopy mode for live migration
- "x-colo": COarse-Grain LOck Stepping (COLO) for Non-stop Service

Arguments:

@@ -2882,6 +2883,7 @@ Query current migration capabilities
         - "compress": Multiple compression threads state (json-bool)
         - "events": Migration state change event state (json-bool)
         - "postcopy-ram": postcopy ram state (json-bool)
         - "x-colo": COarse-Grain LOck Stepping for Non-stop Service (json-bool)

Arguments:

@@ -2895,7 +2897,8 @@ Example:
     {"state": false, "capability": "zero-blocks"},
     {"state": false, "capability": "compress"},
     {"state": true, "capability": "events"},
     {"state": false, "capability": "postcopy-ram"}
     {"state": false, "capability": "postcopy-ram"},
     {"state": false, "capability": "x-colo"}
   ]}

migrate-set-parameters
+20 −0
Original line number Diff line number Diff line
/*
 * COarse-grain LOck-stepping Virtual Machines for Non-stop Service (COLO)
 * (a.k.a. Fault Tolerance or Continuous Replication)
 *
 * Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD.
 * Copyright (c) 2016 FUJITSU LIMITED
 * Copyright (c) 2016 Intel Corporation
 *
 * This work is licensed under the terms of the GNU GPL, version 2 or
 * later.  See the COPYING file in the top-level directory.
 */

#ifndef QEMU_COLO_H
#define QEMU_COLO_H

#include "qemu-common.h"

bool colo_supported(void);

#endif
+1 −0
Original line number Diff line number Diff line
@@ -298,6 +298,7 @@ int xbzrle_decode_buffer(uint8_t *src, int slen, uint8_t *dst, int dlen);

int migrate_use_xbzrle(void);
int64_t migrate_xbzrle_cache_size(void);
bool migrate_colo_enabled(void);

int64_t xbzrle_cache_resize(int64_t new_size);

+1 −0
Original line number Diff line number Diff line
common-obj-y += migration.o socket.o fd.o exec.o
common-obj-y += tls.o
common-obj-$(CONFIG_COLO) += colo.o
common-obj-y += vmstate.o
common-obj-y += qemu-file.o
common-obj-y += qemu-file-channel.o

migration/colo.c

0 → 100644
+19 −0
Original line number Diff line number Diff line
/*
 * COarse-grain LOck-stepping Virtual Machines for Non-stop Service (COLO)
 * (a.k.a. Fault Tolerance or Continuous Replication)
 *
 * Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD.
 * Copyright (c) 2016 FUJITSU LIMITED
 * Copyright (c) 2016 Intel Corporation
 *
 * This work is licensed under the terms of the GNU GPL, version 2 or
 * later.  See the COPYING file in the top-level directory.
 */

#include "qemu/osdep.h"
#include "migration/colo.h"

bool colo_supported(void)
{
    return false;
}
Loading