qemu-devel
[Top][All Lists]
Advanced

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

[PULL 29/30] migration: Move migrate_postcopy() to options.c


From: Juan Quintela
Subject: [PULL 29/30] migration: Move migrate_postcopy() to options.c
Date: Mon, 24 Apr 2023 15:27:29 +0200

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
---
 migration/migration.c | 5 -----
 migration/migration.h | 2 --
 migration/options.c   | 8 ++++++++
 migration/options.h   | 9 +++++++++
 4 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index dccad95a55..f20d7bcc06 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2245,11 +2245,6 @@ void qmp_migrate_continue(MigrationStatus state, Error 
**errp)
     qemu_sem_post(&s->pause_sem);
 }
 
-bool migrate_postcopy(void)
-{
-    return migrate_postcopy_ram() || migrate_dirty_bitmaps();
-}
-
 int migrate_use_tls(void)
 {
     MigrationState *s;
diff --git a/migration/migration.h b/migration/migration.h
index 3ae938b19c..dcf906868d 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -447,8 +447,6 @@ bool migration_is_blocked(Error **errp);
 bool migration_in_postcopy(void);
 MigrationState *migrate_get_current(void);
 
-bool migrate_postcopy(void);
-
 int migrate_use_tls(void);
 
 uint64_t ram_get_total_transferred_pages(void);
diff --git a/migration/options.c b/migration/options.c
index 615534c151..8bd2d949ae 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -204,6 +204,14 @@ bool migrate_zero_copy_send(void)
 
     return s->capabilities[MIGRATION_CAPABILITY_ZERO_COPY_SEND];
 }
+
+/* pseudo capabilities */
+
+bool migrate_postcopy(void)
+{
+    return migrate_postcopy_ram() || migrate_dirty_bitmaps();
+}
+
 typedef enum WriteTrackingSupport {
     WT_SUPPORT_UNKNOWN = 0,
     WT_SUPPORT_ABSENT,
diff --git a/migration/options.h b/migration/options.h
index 99f6bbd7a1..093bc907a1 100644
--- a/migration/options.h
+++ b/migration/options.h
@@ -38,6 +38,15 @@ bool migrate_xbzrle(void);
 bool migrate_zero_blocks(void);
 bool migrate_zero_copy_send(void);
 
+/*
+ * pseudo capabilities
+ *
+ * These are functions that are used in a similar way to capabilities
+ * check, but they are not a capability.
+ */
+
+bool migrate_postcopy(void);
+
 /* capabilities helpers */
 
 bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp);
-- 
2.39.2




reply via email to

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