[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/12] migration/colo.c: Flush ram cache only after receiving devi
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 09/12] migration/colo.c: Flush ram cache only after receiving device state |
Date: |
Mon, 1 Jun 2020 19:40:01 +0100 |
From: Lukas Straub <lukasstraub2@web.de>
If we suceed in receiving ram state, but fail receiving the device
state, there will be a mismatch between the two.
Fix this by flushing the ram cache only after the vmstate has been
received.
Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Message-Id:
<3289d007d494cb0e2f05b1cf4ae6a78d300fede3.1589193382.git.lukasstraub2@web.de>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/colo.c | 1 +
migration/ram.c | 5 +----
migration/ram.h | 1 +
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/migration/colo.c b/migration/colo.c
index d00b3b9d6b..4105999634 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -748,6 +748,7 @@ static void
colo_incoming_process_checkpoint(MigrationIncomingState *mis,
qemu_mutex_lock_iothread();
vmstate_loading = true;
+ colo_flush_ram_cache();
ret = qemu_load_device_state(fb);
if (ret < 0) {
error_setg(errp, "COLO: load device state failed");
diff --git a/migration/ram.c b/migration/ram.c
index 859f835f1a..41cc530d9d 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3360,7 +3360,7 @@ static bool postcopy_is_running(void)
* Flush content of RAM cache into SVM's memory.
* Only flush the pages that be dirtied by PVM or SVM or both.
*/
-static void colo_flush_ram_cache(void)
+void colo_flush_ram_cache(void)
{
RAMBlock *block = NULL;
void *dst_host;
@@ -3632,9 +3632,6 @@ static int ram_load(QEMUFile *f, void *opaque, int
version_id)
}
trace_ram_load_complete(ret, seq_iter);
- if (!ret && migration_incoming_in_colo_state()) {
- colo_flush_ram_cache();
- }
return ret;
}
diff --git a/migration/ram.h b/migration/ram.h
index 5ceaff7cb4..2eeaacfa13 100644
--- a/migration/ram.h
+++ b/migration/ram.h
@@ -65,6 +65,7 @@ int ram_dirty_bitmap_reload(MigrationState *s, RAMBlock *rb);
/* ram cache */
int colo_init_ram_cache(void);
+void colo_flush_ram_cache(void);
void colo_release_ram_cache(void);
void colo_incoming_start_dirty_log(void);
--
2.26.2
- Re: [PULL 04/12] hmp: Simplify qom-set, (continued)
- Re: [PULL 04/12] hmp: Simplify qom-set, Dr. David Alan Gilbert, 2020/06/03
- Re: [PULL 04/12] hmp: Simplify qom-set, David Hildenbrand, 2020/06/03
- Re: [PULL 04/12] hmp: Simplify qom-set, Dr. David Alan Gilbert, 2020/06/03
- Re: [PULL 04/12] hmp: Simplify qom-set, David Hildenbrand, 2020/06/03
- Re: [PULL 04/12] hmp: Simplify qom-set, David Hildenbrand, 2020/06/03
- Re: [PULL 04/12] hmp: Simplify qom-set, Dr. David Alan Gilbert, 2020/06/03
[PULL 01/12] migration/rdma: fix potential nullptr access in rdma_start_incoming_migration, Dr. David Alan Gilbert (git), 2020/06/01
[PULL 05/12] virtiofsd: remove symlink fallbacks, Dr. David Alan Gilbert (git), 2020/06/01
[PULL 08/12] migration/colo.c: Use cpu_synchronize_all_states(), Dr. David Alan Gilbert (git), 2020/06/01
[PULL 06/12] migration/vmstate: Remove unnecessary MemoryRegion forward declaration, Dr. David Alan Gilbert (git), 2020/06/01
[PULL 09/12] migration/colo.c: Flush ram cache only after receiving device state,
Dr. David Alan Gilbert (git) <=
[PULL 10/12] migration/colo.c: Relaunch failover even if there was an error, Dr. David Alan Gilbert (git), 2020/06/01
[PULL 07/12] migration/colo.c: Use event instead of semaphore, Dr. David Alan Gilbert (git), 2020/06/01
[PULL 11/12] migration/colo.c: Move colo_notify_compares_event to the right place, Dr. David Alan Gilbert (git), 2020/06/01
[PULL 12/12] migration/migration.c: Fix hang in ram_save_host_page, Dr. David Alan Gilbert (git), 2020/06/01
Re: [PULL 00/12] migration/virtiofs/hmp queue, Peter Maydell, 2020/06/02