diff options
author | Steve Sistare <steven.sistare@oracle.com> | 2024-02-22 09:28:40 -0800 |
---|---|---|
committer | Peter Xu <peterx@redhat.com> | 2024-02-28 11:31:28 +0800 |
commit | cbdafc1b348b9a9dd6e0e6c82ff3e281c93205fe (patch) | |
tree | 36ff817b224d2fb21efdf61e8167a32671ab68a5 /migration/migration.c | |
parent | ce5db1cb49538d9e07e5bb8ca11e9c9ceb1fce50 (diff) |
migration: options incompatible with cpr
Fail the migration request if options are set that are incompatible
with cpr.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/1708622920-68779-15-git-send-email-steven.sistare@oracle.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r-- | migration/migration.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/migration/migration.c b/migration/migration.c index 90a90947fb..7652fd4d14 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1953,6 +1953,23 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, return false; } + if (migrate_mode_is_cpr(s)) { + const char *conflict = NULL; + + if (migrate_postcopy()) { + conflict = "postcopy"; + } else if (migrate_background_snapshot()) { + conflict = "background snapshot"; + } else if (migrate_colo()) { + conflict = "COLO"; + } + + if (conflict) { + error_setg(errp, "Cannot use %s with CPR", conflict); + return false; + } + } + if (blk || blk_inc) { if (migrate_colo()) { error_setg(errp, "No disk migration is required in COLO mode"); |