From patchwork Wed Oct 31 11:19:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Orit Wasserman X-Patchwork-Id: 195847 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 69FB12C00BE for ; Wed, 31 Oct 2012 22:19:48 +1100 (EST) Received: from localhost ([::1]:51792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTWKo-0008O1-F5 for incoming@patchwork.ozlabs.org; Wed, 31 Oct 2012 07:19:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTWKd-0008Nw-1c for qemu-devel@nongnu.org; Wed, 31 Oct 2012 07:19:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTWKc-0002bJ-2h for qemu-devel@nongnu.org; Wed, 31 Oct 2012 07:19:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTWKb-0002ZP-Qj for qemu-devel@nongnu.org; Wed, 31 Oct 2012 07:19:34 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9VBJW1U004982 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 31 Oct 2012 07:19:32 -0400 Received: from dhcp-1-120.tlv.redhat.com (vpn-200-201.tlv.redhat.com [10.35.200.201]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q9VBJP09012605; Wed, 31 Oct 2012 07:19:28 -0400 From: Orit Wasserman To: qemu-devel@nongnu.org Date: Wed, 31 Oct 2012 13:19:41 +0200 Message-Id: <1351682381-8793-1-git-send-email-owasserm@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: pbonzini@redhat.com, aliguori@us.ibm.com, Orit Wasserman , avi@redhat.com, quintela@redhat.com Subject: [Qemu-devel] [PATCH] Fix calculation of number of bits in the migration bitmap X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The number of bits is off by one, for example if last_ram_offset is 0x1000 (the guest has one page) we get 0 bits instead of 1. Signed-off-by: Orit Wasserman --- arch_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch_init.c b/arch_init.c index b75a4c5..a80c3c8 100644 --- a/arch_init.c +++ b/arch_init.c @@ -565,7 +565,7 @@ static void reset_ram_globals(void) static int ram_save_setup(QEMUFile *f, void *opaque) { RAMBlock *block; - int64_t ram_pages = last_ram_offset() >> TARGET_PAGE_BITS; + int64_t ram_pages = (last_ram_offset() >> TARGET_PAGE_BITS) + 1; migration_bitmap = bitmap_new(ram_pages); bitmap_set(migration_bitmap, 0, ram_pages);