From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: [PATCH] Enable dirty logging for all regions during migration Date: Tue, 12 May 2009 20:24:14 -0300 Message-ID: <1242170654-8685-1-git-send-email-glommer@redhat.com> Cc: avi@redhat.com, ehabkost@redhat.com, Glauber de Oliveira Costa To: kvm@vger.kernel.org Return-path: Received: from mx2.redhat.com ([66.187.237.31]:60473 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755218AbZELXYV (ORCPT ); Tue, 12 May 2009 19:24:21 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4CNOLCX027688 for ; Tue, 12 May 2009 19:24:21 -0400 Sender: kvm-owner@vger.kernel.org List-ID: From: Glauber de Oliveira Costa In current calculations, we are not activating dirty logging for all regions, leading migration to fail. This problem was already raised by Yaniv Kamay a while ago. The proposed solution at the time (not merged), was a calculation to convert from target_phys_addr_t to ram_addr_t, which the dirty logging code expects. Avi noticed that enabling dirty logging for the region 0 -> -1ULL would do the trick. As I hit the problem, I can confirm it does. This patch, therefore, goes with this simpler approach. Before this patch, migration fails. With this patch, simple migration tests succeds. Signed-off-by: Glauber de Oliveira Costa --- qemu-kvm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/qemu-kvm.c b/qemu-kvm.c index f55cee8..b5d4313 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1244,7 +1244,7 @@ int kvm_update_dirty_pages_log(void) int r = 0; - r = kvm_get_dirty_pages_range(kvm_context, 0, phys_ram_size, + r = kvm_get_dirty_pages_range(kvm_context, 0, -1ULL, kvm_dirty_bitmap, NULL, kvm_get_dirty_bitmap_cb); return r; -- 1.6.2.2