From: Marcelo Tosatti <[email protected]>

There is no need to update the dirty log from inside ram_save_block,
since this happens through cpu_physical_sync_dirty_bitmap.

In stage 3, where the VM is stopped, cpu_physical_sync_dirty_bitmap
guarantees dirty log is synchronized before migration finishes.

Signed-off-by: Marcelo Tosatti <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>

diff --git a/qemu-kvm.c b/qemu-kvm.c
index 4d19c80..c9ad87a 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -2346,20 +2346,6 @@ static int kvm_get_dirty_bitmap_cb(unsigned long start, 
unsigned long len,
     return kvm_get_dirty_pages_log_range(start, bitmap, start, len);
 }
 
-/* 
- * get kvm's dirty pages bitmap and update qemu's
- * we only care about physical ram, which resides in slots 0 and 3
- */
-int kvm_update_dirty_pages_log(void)
-{
-    int r = 0;
-
-
-    r = kvm_get_dirty_pages_range(kvm_context, 0, -1UL, NULL,
-                                  kvm_get_dirty_bitmap_cb);
-    return r;
-}
-
 void kvm_qemu_log_memory(target_phys_addr_t start, target_phys_addr_t size,
                          int log)
 {
diff --git a/qemu-kvm.h b/qemu-kvm.h
index 0cbc6f7..8879193 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -836,7 +836,6 @@ void kvm_hpet_disable_kpit(void);
 int kvm_set_irq(int irq, int level, int *status);
 
 int kvm_physical_memory_set_dirty_tracking(int enable);
-int kvm_update_dirty_pages_log(void);
 
 void qemu_kvm_call_with_env(void (*func)(void *), void *data, CPUState *env);
 void qemu_kvm_cpuid_on_env(CPUState *env);
diff --git a/vl.c b/vl.c
index 9b6915b..d959fdb 100644
--- a/vl.c
+++ b/vl.c
@@ -2791,15 +2791,6 @@ static int ram_save_block(QEMUFile *f)
     int found = 0;
 
     while (addr < last_ram_offset) {
-        if (kvm_enabled() && current_addr == 0) {
-            int r;
-            r = kvm_update_dirty_pages_log();
-            if (r) {
-                fprintf(stderr, "%s: update dirty pages log failed %d\n", 
__FUNCTION__, r);
-                qemu_file_set_error(f);
-                return 0;
-            }
-        }
         if (cpu_physical_memory_get_dirty(current_addr, MIGRATION_DIRTY_FLAG)) 
{
             uint8_t *p;
 
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to