From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ydg0G-0004Qm-Go for qemu-devel@nongnu.org; Thu, 02 Apr 2015 10:21:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ydg0F-00030G-Fi for qemu-devel@nongnu.org; Thu, 02 Apr 2015 10:21:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ydg0F-000303-7g for qemu-devel@nongnu.org; Thu, 02 Apr 2015 10:21:51 -0400 From: Paolo Bonzini Date: Thu, 2 Apr 2015 16:21:30 +0200 Message-Id: <1427984491-23475-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1427984491-23475-1-git-send-email-pbonzini@redhat.com> References: <1427984491-23475-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 5/6] kvm-all: Sync dirty-bitmap from kvm before kvm destroy the corresponding dirty_bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: zhanghailiang From: zhanghailiang Sometimes, we destroy the dirty_bitmap in kvm_memory_slot before any sync action occur, this bit in dirty_bitmap will be missed, and which will lead the corresponding dirty pages to be missed in migration. This usually happens when do migration during VM's Start-up or Reboot. Signed-off-by: zhanghailiang [Use s->migration_log instead of exec.c's in_migration. - Paolo] Signed-off-by: Paolo Bonzini --- kvm-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kvm-all.c b/kvm-all.c index 335438a..dd44f8c 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -715,7 +715,7 @@ static void kvm_set_phys_mem(MemoryRegionSection *section, bool add) old = *mem; - if (mem->flags & KVM_MEM_LOG_DIRTY_PAGES) { + if ((mem->flags & KVM_MEM_LOG_DIRTY_PAGES) || s->migration_log) { kvm_physical_sync_dirty_bitmap(section); } -- 2.3.4