Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
migration: block incoming colo when capability is disabled
We generally require same set of capabilities on source and target.
Let's require x-colo capability to use COLO on target.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
Message-Id: <20230428194928.1426370-11-vsementsov@yandex-team.ru>
Signed-off-by: Juan Quintela <quintela@redhat.com>
  • Loading branch information
Vladimir Sementsov-Ogievskiy authored and Juan Quintela committed May 9, 2023
1 parent c08d611 commit 5f43d29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/COLO-FT.txt
Expand Up @@ -210,6 +210,7 @@ children.0=childs0 \

3. On Secondary VM's QEMU monitor, issue command
{"execute":"qmp_capabilities"}
{"execute": "migrate-set-capabilities", "arguments": {"capabilities": [ {"capability": "x-colo", "state": true } ] } }
{"execute": "nbd-server-start", "arguments": {"addr": {"type": "inet", "data": {"host": "0.0.0.0", "port": "9999"} } } }
{"execute": "nbd-server-add", "arguments": {"device": "parent0", "writable": true } }

Expand Down
6 changes: 6 additions & 0 deletions migration/migration.c
Expand Up @@ -398,6 +398,12 @@ int migration_incoming_enable_colo(void)
return -ENOTSUP;
#endif

if (!migrate_colo()) {
error_report("ENABLE_COLO command come in migration stream, but c-colo "
"capability is not set");
return -EINVAL;
}

if (ram_block_discard_disable(true)) {
error_report("COLO: cannot disable RAM discard");
return -EBUSY;
Expand Down

0 comments on commit 5f43d29

Please sign in to comment.