From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35897 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNeV3-0002LB-Iv for qemu-devel@nongnu.org; Tue, 30 Nov 2010 23:41:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNRMA-0000Tl-VC for qemu-devel@nongnu.org; Tue, 30 Nov 2010 09:39:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNRMA-0000Dr-Hj for qemu-devel@nongnu.org; Tue, 30 Nov 2010 09:38:58 -0500 From: Juan Quintela In-Reply-To: <4CF45C0C.705@codemonkey.ws> (Anthony Liguori's message of "Mon, 29 Nov 2010 20:06:04 -0600") References: <24346c6699fced39ed3725938091984ed23f48e5.1290552026.git.quintela@redhat.com> <4CF45C0C.705@codemonkey.ws> Date: Tue, 30 Nov 2010 15:38:45 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 07/10] ram_save_remaining() returns an uint64_t List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Anthony Liguori wrote: > On 11/23/2010 05:03 PM, Juan Quintela wrote: >> From: Juan Quintela >> >> It returns a counter of things, not a ram address. >> >> Signed-off-by: Juan Quintela >> Signed-off-by: Juan Quintela >> --- >> arch_init.c | 4 ++-- >> 1 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/arch_init.c b/arch_init.c >> index df3d91f..9e941a0 100644 >> --- a/arch_init.c >> +++ b/arch_init.c >> @@ -173,10 +173,10 @@ static int ram_save_block(QEMUFile *f) >> >> static uint64_t bytes_transferred; >> >> -static ram_addr_t ram_save_remaining(void) >> +static uint64_t ram_save_remaining(void) >> { >> RAMBlock *block; >> - ram_addr_t count = 0; >> + uint64_t count = 0; >> >> QLIST_FOREACH(block,&ram_list.blocks, next) { >> ram_addr_t addr; >> > > No, it returns a count of bytes of ram which is a subset of > ram_addr_t's space. The unit is definitely right here. I thought this would be un-controversial. But the important part from your sentence is "count". ram_addr_t is an addr in my mind. /* address in the RAM (different from a physical address) */ typedef unsigned long ram_addr_t; in cpu-common.h comment, it is also an address. But doing more grepping I see that it is "conveniently" used as a size in other places. Later, Juan. > Regards, > > Anthony Liguori