diff mbox series

[3/8] colo: Replace migration_incoming_colo_enabled() with migrate_colo()

Message ID 1e6ab707c554a5ae8aa7497cc988f5032a2d1351.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:15 p.m. UTC
Signed-off-by: Lukas Straub <lukasstraub2@web.de>
---
 include/migration/colo.h | 1 -
 migration/colo.c         | 2 +-
 migration/migration.c    | 7 +------
 migration/ram.c          | 2 +-
 4 files changed, 3 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/include/migration/colo.h b/include/migration/colo.h
index eaac07f26d..4a1955067b 100644
--- a/include/migration/colo.h
+++ b/include/migration/colo.h
@@ -27,7 +27,6 @@  bool migration_in_colo_state(void);
 /* loadvm */
 int migration_incoming_enable_colo(void);
 void migration_incoming_disable_colo(void);
-bool migration_incoming_colo_enabled(void);
 bool migration_incoming_in_colo_state(void);
 
 COLOMode get_colo_mode(void);
diff --git a/migration/colo.c b/migration/colo.c
index 72f4f7b37e..8b0e7c9af3 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -927,7 +927,7 @@  int coroutine_fn colo_incoming_co(void)
 
     assert(qemu_mutex_iothread_locked());
 
-    if (!migration_incoming_colo_enabled()) {
+    if (!migrate_colo()) {
         return 0;
     }
 
diff --git a/migration/migration.c b/migration/migration.c
index 050bd8ffc8..2506fd63f7 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -379,11 +379,6 @@  int migrate_send_rp_req_pages(MigrationIncomingState *mis,
 }
 
 static bool migration_colo_enabled;
-bool migration_incoming_colo_enabled(void)
-{
-    return migration_colo_enabled;
-}
-
 void migration_incoming_disable_colo(void)
 {
     ram_block_discard_disable(false);
@@ -484,7 +479,7 @@  static void process_incoming_migration_bh(void *opaque)
         } else {
             runstate_set(RUN_STATE_PAUSED);
         }
-    } else if (migration_incoming_colo_enabled()) {
+    } else if (migrate_colo()) {
         migration_incoming_disable_colo();
         vm_start();
     } else {
diff --git a/migration/ram.c b/migration/ram.c
index 5283a75f02..e3eadd08cd 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3892,7 +3892,7 @@  static int ram_load_precopy(QEMUFile *f)
              * speed of the migration, but it obviously reduce the downtime of
              * back-up all SVM'S memory in COLO preparing stage.
              */
-            if (migration_incoming_colo_enabled()) {
+            if (migrate_colo()) {
                 if (migration_incoming_in_colo_state()) {
                     /* In COLO stage, put all pages into cache temporarily */
                     host = colo_cache_from_block_offset(block, addr, true);