diff mbox

[RFC,RDMA,support,v6:,7/7] introduce qemu_ram_foreach_block()

Message ID 1365568180-19593-8-git-send-email-mrhines@linux.vnet.ibm.com
State New
Headers show

Commit Message

mrhines@linux.vnet.ibm.com April 10, 2013, 4:29 a.m. UTC
From: "Michael R. Hines" <mrhines@us.ibm.com>

This is used during RDMA initialization in order to transmit
a description of all the RAM blocks to the peer for later
dynamic chunk registration purposes.

Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
---
 exec.c                    |    9 +++++++++
 include/exec/cpu-common.h |    5 +++++
 2 files changed, 14 insertions(+)

Comments

Paolo Bonzini April 10, 2013, 7:47 a.m. UTC | #1
Il 10/04/2013 06:29, mrhines@linux.vnet.ibm.com ha scritto:
> From: "Michael R. Hines" <mrhines@us.ibm.com>
> 
> This is used during RDMA initialization in order to transmit
> a description of all the RAM blocks to the peer for later
> dynamic chunk registration purposes.

why did you move this after patch 5???

Paolo
mrhines@linux.vnet.ibm.com April 10, 2013, 12:36 p.m. UTC | #2
On 04/10/2013 03:47 AM, Paolo Bonzini wrote:
> Il 10/04/2013 06:29, mrhines@linux.vnet.ibm.com ha scritto:
>> From: "Michael R. Hines" <mrhines@us.ibm.com>
>>
>> This is used during RDMA initialization in order to transmit
>> a description of all the RAM blocks to the peer for later
>> dynamic chunk registration purposes.
> why did you move this after patch 5???
>
> Paolo
>

Was just trying to be nice and move the less significant patch
to the end of the series, but I'm happy to move it back.
diff mbox

Patch

diff --git a/exec.c b/exec.c
index fa1e0c3..0e5a2c3 100644
--- a/exec.c
+++ b/exec.c
@@ -2631,3 +2631,12 @@  bool cpu_physical_memory_is_io(hwaddr phys_addr)
              memory_region_is_romd(section->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 2e5f11f..88cb741 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -119,6 +119,11 @@  extern struct MemoryRegion io_mem_rom;
 extern struct MemoryRegion io_mem_unassigned;
 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
 
 #endif /* !CPU_COMMON_H */