From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTWyh-0008KU-Pm for qemu-devel@nongnu.org; Wed, 31 Oct 2012 08:01:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTWyT-0008Uh-Ui for qemu-devel@nongnu.org; Wed, 31 Oct 2012 08:00:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTWyT-0008JL-Mx for qemu-devel@nongnu.org; Wed, 31 Oct 2012 08:00:45 -0400 Message-ID: <509112E3.3010703@redhat.com> Date: Wed, 31 Oct 2012 14:00:35 +0200 From: Orit Wasserman MIME-Version: 1.0 References: <1351682381-8793-1-git-send-email-owasserm@redhat.com> <50910A60.3030305@redhat.com> In-Reply-To: <50910A60.3030305@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Fix calculation of number of bits in the migration bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, quintela@redhat.com On 10/31/2012 01:24 PM, Avi Kivity wrote: > On 10/31/2012 01:19 PM, Orit Wasserman wrote: >> 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; >> > > The original code calculates 1 for your example case. You correct ... sorry ... > >