diff options
| author | Peter Xu <peterx@redhat.com> | 2024-10-24 17:30:52 -0400 |
|---|---|---|
| committer | Peter Xu <peterx@redhat.com> | 2024-10-31 15:48:18 -0400 |
| commit | f018eb62b2bb7618b0cb8a796ac4b76fd786ecaf (patch) | |
| tree | 6d93fec9312cea0071a58734b720dd46b22fdbfc /migration/ram.c | |
| parent | 64dcd2c9c627b88ec7d071e1b49f0180b467fc71 (diff) | |
| download | focaccia-qemu-f018eb62b2bb7618b0cb8a796ac4b76fd786ecaf.tar.gz focaccia-qemu-f018eb62b2bb7618b0cb8a796ac4b76fd786ecaf.zip | |
migration: Drop migration_is_setup_or_active()
This helper is mostly the same as migration_is_running(), except that one has COLO reported as true, the other has CANCELLING reported as true. Per my past years experience on the state changes, none of them should matter. To make it slightly safer, report both COLO || CANCELLING to be true in migration_is_running(), then drop the other one. We kept the 1st only because the name is simpler, and clear enough. Reviewed-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Fabiano Rosas <farosas@suse.de> Link: https://lore.kernel.org/r/20241024213056.1395400-5-peterx@redhat.com Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/ram.c')
| -rw-r--r-- | migration/ram.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/migration/ram.c b/migration/ram.c index b24e45442c..9d9daccedc 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2860,7 +2860,7 @@ void qemu_guest_free_page_hint(void *addr, size_t len) size_t used_len, start, npages; /* This function is currently expected to be used during live migration */ - if (!migration_is_setup_or_active()) { + if (!migration_is_running()) { return; } @@ -3208,8 +3208,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) } out: - if (ret >= 0 - && migration_is_setup_or_active()) { + if (ret >= 0 && migration_is_running()) { if (migrate_multifd() && migrate_multifd_flush_after_each_section() && !migrate_mapped_ram()) { ret = multifd_ram_flush_and_sync(); |