This capability allows Primary VM (PVM) to be continuously checkpointed to secondary VM.
Signed-off-by: zhanghailiang <zhang.zhanghaili...@huawei.com> Signed-off-by: Yang Hongyang <yan...@cn.fujitsu.com> Signed-off-by: Gonglei <arei.gong...@huawei.com> Signed-off-by: Lai Jiangshan <la...@cn.fujitsu.com> --- include/migration/migration.h | 1 + migration/migration.c | 15 +++++++++++++++ qapi-schema.json | 5 ++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index f37348b..3f5c705 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -154,6 +154,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_enable_colo(void); int64_t xbzrle_cache_resize(int64_t new_size); diff --git a/migration/migration.c b/migration/migration.c index b3adbc6..8403c8a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -276,6 +276,15 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params, } for (cap = params; cap; cap = cap->next) { +#ifndef CONFIG_COLO + if (cap->value->capability == MIGRATION_CAPABILITY_COLO && + cap->value->state) { + error_setg(errp, "COLO is not currently supported, please" + " configure with --enable-colo option in order to" + " support COLO feature"); + continue; + } +#endif s->enabled_capabilities[cap->value->capability] = cap->value->state; } } @@ -585,6 +594,12 @@ int64_t migrate_xbzrle_cache_size(void) return s->xbzrle_cache_size; } +bool migrate_enable_colo(void) +{ + MigrationState *s = migrate_get_current(); + return s->enabled_capabilities[MIGRATION_CAPABILITY_COLO]; +} + /* migration thread support */ static void *migration_thread(void *opaque) diff --git a/qapi-schema.json b/qapi-schema.json index e16f8eb..8c59e50 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -494,10 +494,13 @@ # @auto-converge: If enabled, QEMU will automatically throttle down the guest # to speed up convergence of RAM migration. (since 1.6) # +# @colo: If enabled, the migration will never end, and the VM will instead be +# continuously checkpointed. (since 2.3) +# # Since: 1.2 ## { 'enum': 'MigrationCapability', - 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks'] } + 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks', 'colo'] } ## # @MigrationCapabilityStatus -- 1.7.12.4