From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsIKa-0000RX-8I for qemu-devel@nongnu.org; Thu, 27 Jun 2013 15:58:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsIKX-0004AD-AG for qemu-devel@nongnu.org; Thu, 27 Jun 2013 15:58:12 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:60030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsIKX-0004A1-2q for qemu-devel@nongnu.org; Thu, 27 Jun 2013 15:58:09 -0400 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 27 Jun 2013 13:58:07 -0600 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 203943E40040 for ; Thu, 27 Jun 2013 13:57:44 -0600 (MDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5RJw0Ft078494 for ; Thu, 27 Jun 2013 13:58:02 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r5RK0T46006247 for ; Thu, 27 Jun 2013 14:00:29 -0600 Message-ID: <51CC9907.4050800@linux.vnet.ibm.com> Date: Thu, 27 Jun 2013 15:56:55 -0400 From: "Michael R. Hines" MIME-Version: 1.0 References: <1372210541-28092-1-git-send-email-mrhines@linux.vnet.ibm.com> <1372210541-28092-9-git-send-email-mrhines@linux.vnet.ibm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v12 08/15] rdma: introduce qemu_ram_foreach_block() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: aliguori@us.ibm.com, quintela@redhat.com, qemu-devel@nongnu.org, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com, pbonzini@redhat.com, chegu_vinod@hp.com, knoel@redhat.com On 06/27/2013 03:24 PM, Peter Maydell wrote: > On 26 June 2013 02:35, wrote: >> --- a/exec.c >> +++ b/exec.c >> @@ -2630,3 +2630,12 @@ bool cpu_physical_memory_is_io(hwaddr phys_addr) >> memory_region_is_romd(mr)); >> } >> #endif >> + >> +void qemu_ram_foreach_block(RAMBlockIterFunc func, void *opaque) >> +{ >> + RAMBlock *block; >> + >> + QTAILQ_FOREACH(block, &ram_list.blocks, next) { >> + func(block->host, block->offset, block->length, opaque); >> + } >> +} >> diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h >> index e061e21..92a4223 100644 >> --- a/include/exec/cpu-common.h >> +++ b/include/exec/cpu-common.h >> @@ -113,6 +113,11 @@ void cpu_physical_memory_write_rom(hwaddr addr, >> extern struct MemoryRegion io_mem_rom; >> extern struct MemoryRegion io_mem_notdirty; >> >> +typedef void (RAMBlockIterFunc)(void *host_addr, >> + ram_addr_t offset, ram_addr_t length, void *opaque); >> + >> +void qemu_ram_foreach_block(RAMBlockIterFunc func, void *opaque); >> + >> #endif > The prototype is inside an ifndef CONFIG_USER_ONLY -- the > implementation needs to be as well. > > thanks > -- PMM > Good catch. I'll send it in the next patch series ASAP. - Michael