qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Lukas Straub
Subject: [PATCH 8/8] ram: Remove useless colo special-casing
Date: Thu, 22 Jun 2023 14:16:44 +0200

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 --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() {
-- 
2.39.2

Attachment: pgpqEakdPx8Y7.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]