qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Dr. David Alan Gilbert" <dave@treblig.org>,
	Leonardo Bras <leobras@redhat.com>,
	Hanna Reitz <hreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Hailiang Zhang <zhanghailiang@xfusion.com>,
	Eric Blake <eblake@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	qemu-block@nongnu.org, Peter Xu <peterx@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	Lukas Straub <lukasstraub2@web.de>,
	Zhang Chen <chen.zhang@intel.com>
Subject: [PULL 10/10] migration: block incoming colo when capability is disabled
Date: Tue,  9 May 2023 21:17:24 +0200	[thread overview]
Message-ID: <20230509191724.86159-11-quintela@redhat.com> (raw)
In-Reply-To: <20230509191724.86159-1-quintela@redhat.com>

From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>

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>
---
 docs/COLO-FT.txt      | 1 +
 migration/migration.c | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/docs/COLO-FT.txt b/docs/COLO-FT.txt
index 8ec653f81c..2e760a4aee 100644
--- a/docs/COLO-FT.txt
+++ b/docs/COLO-FT.txt
@@ -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 } }
 
diff --git a/migration/migration.c b/migration/migration.c
index 4959f7ee44..7558c8edbd 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -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;
-- 
2.40.0



  parent reply	other threads:[~2023-05-09 19:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 19:17 [PULL 00/10] Migration 20230509 patches Juan Quintela
2023-05-09 19:17 ` [PULL 01/10] ram: Add public helper to set colo bitmap Juan Quintela
2023-05-09 19:17 ` [PULL 02/10] ram: Let colo_flush_ram_cache take the bitmap_mutex Juan Quintela
2023-05-09 19:17 ` [PULL 03/10] multifd: Add the ramblock to MultiFDRecvParams Juan Quintela
2023-05-09 19:17 ` [PULL 04/10] block/meson.build: prefer positive condition for replication Juan Quintela
2023-05-09 19:17 ` [PULL 05/10] colo: make colo_checkpoint_notify static and provide simpler API Juan Quintela
2023-05-09 19:17 ` [PULL 06/10] build: move COLO under CONFIG_REPLICATION Juan Quintela
2023-05-09 19:17 ` [PULL 07/10] migration: drop colo_incoming_thread from MigrationIncomingState Juan Quintela
2023-05-09 19:17 ` [PULL 08/10] migration: process_incoming_migration_co: simplify code flow around ret Juan Quintela
2023-05-09 19:17 ` [PULL 09/10] migration: disallow change capabilities in COLO state Juan Quintela
2023-05-09 19:17 ` Juan Quintela [this message]
2023-05-10 10:17 ` [PULL 00/10] Migration 20230509 patches Richard Henderson
2023-05-10 12:20   ` Juan Quintela
2023-05-10 12:35     ` Richard Henderson
2023-05-10 14:08       ` Juan Quintela
2023-05-10 14:46         ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2023-05-10 18:09 Juan Quintela
2023-05-10 18:09 ` [PULL 10/10] migration: block incoming colo when capability is disabled Juan Quintela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230509191724.86159-11-quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=armbru@redhat.com \
    --cc=chen.zhang@intel.com \
    --cc=dave@treblig.org \
    --cc=eblake@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=leobras@redhat.com \
    --cc=lukasstraub2@web.de \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@yandex-team.ru \
    --cc=zhanghailiang@xfusion.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).