diff mbox series

[8/8] ram: Remove useless colo special-casing

Message ID 5f9a18890044d4c9801c47e9e49a35cbb882a523.1687429356.git.lukasstraub2@web.de (mailing list archive)
State New, archived
Headers show
Series colo migration cleanups | expand

Commit Message

Lukas Straub June 22, 2023, 12:16 p.m. UTC
This is not needed, as colo primary side everything is more or less
a new migration for every checkpoint.

Also, we only enter colo mode after the precopy migration is finished
so this if is always taken. Still add an assert just in case.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
---
 migration/ram.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/migration/ram.c b/migration/ram.c
index e3eadd08cd..e5c1146360 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2994,17 +2994,17 @@  static int ram_save_setup(QEMUFile *f, void *opaque)
     RAMBlock *block;
     int ret;
 
+    assert(!migration_in_colo_state());
+
     if (compress_threads_save_setup()) {
         return -1;
     }
 
-    /* migration has already setup the bitmap, reuse it. */
-    if (!migration_in_colo_state()) {
-        if (ram_init_all(rsp) != 0) {
-            compress_threads_save_cleanup();
-            return -1;
-        }
+    if (ram_init_all(rsp) != 0) {
+        compress_threads_save_cleanup();
+        return -1;
     }
+
     (*rsp)->pss[RAM_CHANNEL_PRECOPY].pss_channel = f;
 
     WITH_RCU_READ_LOCK_GUARD() {