[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/30] migration/ram: Factor out check for advised postcopy
From: |
Juan Quintela |
Subject: |
[PULL 16/30] migration/ram: Factor out check for advised postcopy |
Date: |
Tue, 7 Feb 2023 01:56:36 +0100 |
From: David Hildenbrand <david@redhat.com>
Let's factor out this check, to be used in virtio-mem context next.
While at it, fix a spelling error in a related comment.
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>S
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
include/migration/misc.h | 4 +++-
migration/migration.c | 7 +++++++
migration/ram.c | 8 +-------
3 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/include/migration/misc.h b/include/migration/misc.h
index 465906710d..8b49841016 100644
--- a/include/migration/misc.h
+++ b/include/migration/misc.h
@@ -67,8 +67,10 @@ bool migration_has_failed(MigrationState *);
/* ...and after the device transmission */
bool migration_in_postcopy_after_devices(MigrationState *);
void migration_global_dump(Monitor *mon);
-/* True if incomming migration entered POSTCOPY_INCOMING_DISCARD */
+/* True if incoming migration entered POSTCOPY_INCOMING_DISCARD */
bool migration_in_incoming_postcopy(void);
+/* True if incoming migration entered POSTCOPY_INCOMING_ADVISE */
+bool migration_incoming_postcopy_advised(void);
/* True if background snapshot is active */
bool migration_in_bg_snapshot(void);
diff --git a/migration/migration.c b/migration/migration.c
index c3ad4cd670..f321e419c7 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2126,6 +2126,13 @@ bool migration_in_incoming_postcopy(void)
return ps >= POSTCOPY_INCOMING_DISCARD && ps < POSTCOPY_INCOMING_END;
}
+bool migration_incoming_postcopy_advised(void)
+{
+ PostcopyState ps = postcopy_state_get();
+
+ return ps >= POSTCOPY_INCOMING_ADVISE && ps < POSTCOPY_INCOMING_END;
+}
+
bool migration_in_bg_snapshot(void)
{
MigrationState *s = migrate_get_current();
diff --git a/migration/ram.c b/migration/ram.c
index 7f6d5efe8d..b966e148c2 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -4150,12 +4150,6 @@ int ram_load_postcopy(QEMUFile *f, int channel)
return ret;
}
-static bool postcopy_is_advised(void)
-{
- PostcopyState ps = postcopy_state_get();
- return ps >= POSTCOPY_INCOMING_ADVISE && ps < POSTCOPY_INCOMING_END;
-}
-
static bool postcopy_is_running(void)
{
PostcopyState ps = postcopy_state_get();
@@ -4226,7 +4220,7 @@ static int ram_load_precopy(QEMUFile *f)
MigrationIncomingState *mis = migration_incoming_get_current();
int flags = 0, ret = 0, invalid_flags = 0, len = 0, i = 0;
/* ADVISE is earlier, it shows the source has the postcopy capability on */
- bool postcopy_advised = postcopy_is_advised();
+ bool postcopy_advised = migration_incoming_postcopy_advised();
if (!migrate_use_compression()) {
invalid_flags |= RAM_SAVE_FLAG_COMPRESS_PAGE;
}
--
2.39.1
- [PULL 04/30] migration: Remove unused threshold_size parameter, (continued)
- [PULL 04/30] migration: Remove unused threshold_size parameter, Juan Quintela, 2023/02/06
- [PULL 06/30] util/userfaultfd: Add uffd_open(), Juan Quintela, 2023/02/06
- [PULL 07/30] migration/ram: Fix populate_read_range(), Juan Quintela, 2023/02/06
- [PULL 08/30] migration/ram: Fix error handling in ram_write_tracking_start(), Juan Quintela, 2023/02/06
- [PULL 09/30] migration/ram: Don't explicitly unprotect when unregistering uffd-wp, Juan Quintela, 2023/02/06
- [PULL 10/30] migration/ram: Rely on used_length for uffd_change_protection(), Juan Quintela, 2023/02/06
- [PULL 11/30] migration/ram: Optimize ram_write_tracking_start() for RamDiscardManager, Juan Quintela, 2023/02/06
- [PULL 13/30] migration/savevm: Prepare vmdesc json writer in qemu_savevm_state_setup(), Juan Quintela, 2023/02/06
- [PULL 12/30] migration/savevm: Move more savevm handling into vmstate_save(), Juan Quintela, 2023/02/06
- [PULL 14/30] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM), Juan Quintela, 2023/02/06
- [PULL 16/30] migration/ram: Factor out check for advised postcopy,
Juan Quintela <=
- [PULL 15/30] migration/vmstate: Introduce VMSTATE_WITH_TMP_TEST() and VMSTATE_BITMAP_TEST(), Juan Quintela, 2023/02/06
- [PULL 17/30] virtio-mem: Fail if a memory backend with "prealloc=on" is specified, Juan Quintela, 2023/02/06
- [PULL 18/30] virtio-mem: Migrate immutable properties early, Juan Quintela, 2023/02/06
- [PULL 19/30] virtio-mem: Proper support for preallocation with migration, Juan Quintela, 2023/02/06
- [PULL 20/30] migration: Show downtime during postcopy phase, Juan Quintela, 2023/02/06
- [PULL 21/30] migration/rdma: fix return value for qio_channel_rdma_{readv, writev}, Juan Quintela, 2023/02/06
- [PULL 22/30] migration: Add canary to VMSTATE_END_OF_LIST, Juan Quintela, 2023/02/06
- [PULL 23/30] migration: Perform vmsd structure check during tests, Juan Quintela, 2023/02/06
- [PULL 24/30] migration/dirtyrate: Show sample pages only in page-sampling mode, Juan Quintela, 2023/02/06
- [PULL 25/30] io: Add support for MSG_PEEK for socket channel, Juan Quintela, 2023/02/06