Skip to content

Commit 8a48520

Browse files
xzpeterMichael Tokarev
authored andcommitted
migration: Allow caps to be set when preempt or multifd cap enabled
With commit 82137e6 ("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: 82137e6 ("migration: enforce multifd and postcopy preempt to be set before incoming") Reviewed-by: Dr. David Alan Gilbert <[email protected]> Reviewed-by: Juraj Marcin <[email protected]> Signed-off-by: Peter Xu <[email protected]> (cherry picked from commit 17bec92) Signed-off-by: Michael Tokarev <[email protected]>
1 parent 7484d61 commit 8a48520

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

migration/options.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,15 +555,15 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp)
555555
return false;
556556
}
557557

558-
if (migrate_incoming_started()) {
558+
if (!migrate_postcopy_preempt() && migrate_incoming_started()) {
559559
error_setg(errp,
560560
"Postcopy preempt must be set before incoming starts");
561561
return false;
562562
}
563563
}
564564

565565
if (new_caps[MIGRATION_CAPABILITY_MULTIFD]) {
566-
if (migrate_incoming_started()) {
566+
if (!migrate_multifd() && migrate_incoming_started()) {
567567
error_setg(errp, "Multifd must be set before incoming starts");
568568
return false;
569569
}

0 commit comments

Comments
 (0)