Message ID | 1365568180-19593-8-git-send-email-mrhines@linux.vnet.ibm.com |
---|---|
State | New |
Headers | show |
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
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 --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 */