From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: Fabiano Rosas <farosas@suse.de>,
Prasad Pandit <ppandit@redhat.com>,
"Dr . David Alan Gilbert" <dave@treblig.org>,
Juraj Marcin <jmarcin@redhat.com>,
peterx@redhat.com
Subject: [PATCH v2 1/2] migration: Allow caps to be set when preempt or multifd cap enabled
Date: Wed, 14 May 2025 16:01:36 -0400 [thread overview]
Message-ID: <20250514200137.581935-2-peterx@redhat.com> (raw)
In-Reply-To: <20250514200137.581935-1-peterx@redhat.com>
With commit 82137e6c8c ("migration: enforce multifd and postcopy preempt to
be set before incoming"), and if postcopy preempt / multifd is enabled, one
cannot setup any capability because these checks would always fail.
(qemu) migrate_set_capability xbzrle off
Error: Postcopy preempt must be set before incoming starts
To fix it, check existing cap and only raise an error if the specific cap
changed.
Fixes: 82137e6c8c ("migration: enforce multifd and postcopy preempt to be set before incoming")
Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
Reviewed-by: Juraj Marcin <jmarcin@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/options.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/migration/options.c b/migration/options.c
index 3fcd577cd7..162c72cda4 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -568,7 +568,7 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp)
return false;
}
- if (migrate_incoming_started()) {
+ if (!migrate_postcopy_preempt() && migrate_incoming_started()) {
error_setg(errp,
"Postcopy preempt must be set before incoming starts");
return false;
@@ -576,7 +576,7 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp)
}
if (new_caps[MIGRATION_CAPABILITY_MULTIFD]) {
- if (migrate_incoming_started()) {
+ if (!migrate_multifd() && migrate_incoming_started()) {
error_setg(errp, "Multifd must be set before incoming starts");
return false;
}
--
2.49.0
next prev parent reply other threads:[~2025-05-14 20:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 20:01 [PATCH v2 0/2] migration: Some fix and enhancements to HMP "info migrate" Peter Xu
2025-05-14 20:01 ` Peter Xu [this message]
2025-05-22 20:15 ` [PATCH v2 1/2] migration: Allow caps to be set when preempt or multifd cap enabled Michael Tokarev
2025-05-14 20:01 ` [PATCH v2 2/2] migration/hmp: Add "info migrate -a", reorg the dump Peter Xu
2025-05-14 20:29 ` Dr. David Alan Gilbert
2025-05-14 21:17 ` Peter Xu
2025-05-14 23:00 ` Dr. David Alan Gilbert
2025-05-21 8:43 ` Zhijian Li (Fujitsu) via
2025-05-21 14:03 ` Peter Xu
2025-05-21 21:04 ` Dr. David Alan Gilbert
2025-05-22 0:55 ` Zhijian Li (Fujitsu) via
2025-05-22 13:16 ` Peter Xu
2025-05-23 2:06 ` Zhijian Li (Fujitsu) via
2025-05-26 15:40 ` Peter Xu
2025-05-22 1:07 ` Zhijian Li (Fujitsu) via
2025-05-19 11:27 ` [PATCH v2 0/2] migration: Some fix and enhancements to HMP "info migrate" Mario Casquero
2025-05-20 17:03 ` Peter Xu
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=20250514200137.581935-2-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=dave@treblig.org \
--cc=farosas@suse.de \
--cc=jmarcin@redhat.com \
--cc=ppandit@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).