[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/8] colo: Reject colo with postcopy capability enabled
From: |
Lukas Straub |
Subject: |
[PATCH 6/8] colo: Reject colo with postcopy capability enabled |
Date: |
Thu, 22 Jun 2023 14:16:03 +0200 |
Signed-off-by: Lukas Straub <lukasstraub2@web.de>
---
migration/migration.c | 5 +++--
migration/options.c | 9 +++++++++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index a954ff4f7d..9860f960f2 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2333,9 +2333,10 @@ static void migration_completion(MigrationState *s)
goto fail;
}
- if (migrate_colo() && s->state == MIGRATION_STATUS_ACTIVE) {
+ if (migrate_colo()) {
/* COLO does not support postcopy */
- migrate_set_state(&s->state, MIGRATION_STATUS_ACTIVE,
+ assert(s->state != MIGRATION_STATUS_POSTCOPY_ACTIVE);
+ migrate_set_state(&s->state, current_active_state,
MIGRATION_STATUS_COLO);
} else {
migrate_set_state(&s->state, current_active_state,
diff --git a/migration/options.c b/migration/options.c
index b62ab30cd5..d3d4525d40 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -445,8 +445,17 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps,
Error **errp)
error_append_hint(errp, "Please enable replication before COLO.\n");
return false;
}
+#else
+ if (new_caps[MIGRATION_CAPABILITY_X_COLO]) {
+ if (new_caps[MIGRATION_CAPABILITY_POSTCOPY_RAM]) {
+ error_setg(errp, "COLO is not compatible with postcopy");
+ return false;
+ }
+ }
#endif
+
+
if (new_caps[MIGRATION_CAPABILITY_POSTCOPY_RAM]) {
/* This check is reasonably expensive, so only when it's being
* set the first time, also it's only the destination that needs
--
2.39.2
pgpVarTWPvyUs.pgp
Description: OpenPGP digital signature
- [PATCH 0/8] colo migration cleanups, Lukas Straub, 2023/06/22
- [PATCH 1/8] colo: Only support the same qemu version on source and destination, Lukas Straub, 2023/06/22
- [PATCH 2/8] colo: Setup ram cache in normal migration path, Lukas Straub, 2023/06/22
- [PATCH 3/8] colo: Replace migration_incoming_colo_enabled() with migrate_colo(), Lukas Straub, 2023/06/22
- [PATCH 5/8] colo: Don't send ENABLE_COLO command, Lukas Straub, 2023/06/22
- [PATCH 6/8] colo: Reject colo with postcopy capability enabled,
Lukas Straub <=
- [PATCH 4/8] colo: Remove ENABLE_COLO loadvm command functions, Lukas Straub, 2023/06/22
- [PATCH 7/8] colo: Reject colo with block migration capability enabled, Lukas Straub, 2023/06/22
- [PATCH 8/8] ram: Remove useless colo special-casing, Lukas Straub, 2023/06/22