From patchwork Tue May 12 23:24:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 23372 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4CNOSr0002255 for ; Tue, 12 May 2009 23:24:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754127AbZELXYW (ORCPT ); Tue, 12 May 2009 19:24:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755025AbZELXYW (ORCPT ); Tue, 12 May 2009 19:24:22 -0400 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 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4CNOK3C031588; Tue, 12 May 2009 19:24:21 -0400 Received: from localhost.localdomain (vpn-10-18.bos.redhat.com [10.16.10.18]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n4CNOF9d023886; Tue, 12 May 2009 19:24:17 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com, ehabkost@redhat.com, Glauber de Oliveira 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> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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;