thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
9ae3a8
From 34bab268a046ceb03e4f925eb8f45a80314c6c34 Mon Sep 17 00:00:00 2001
9ae3a8
Message-Id: <34bab268a046ceb03e4f925eb8f45a80314c6c34.1387382496.git.minovotn@redhat.com>
9ae3a8
In-Reply-To: <c5386144fbf09f628148101bc674e2421cdd16e3.1387382496.git.minovotn@redhat.com>
9ae3a8
References: <c5386144fbf09f628148101bc674e2421cdd16e3.1387382496.git.minovotn@redhat.com>
9ae3a8
From: Nigel Croxon <ncroxon@redhat.com>
9ae3a8
Date: Thu, 14 Nov 2013 22:52:45 +0100
9ae3a8
Subject: [PATCH 09/46] rdma: introduce qemu_ram_foreach_block()
9ae3a8
9ae3a8
RH-Author: Nigel Croxon <ncroxon@redhat.com>
9ae3a8
Message-id: <1384469598-13137-10-git-send-email-ncroxon@redhat.com>
9ae3a8
Patchwork-id: 55693
9ae3a8
O-Subject: [RHEL7.0 PATCH 09/42] rdma: introduce qemu_ram_foreach_block()
9ae3a8
Bugzilla: 1011720
9ae3a8
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
9ae3a8
RH-Acked-by: Amit Shah <amit.shah@redhat.com>
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
9ae3a8
Bugzilla: 1011720
9ae3a8
https://bugzilla.redhat.com/show_bug.cgi?id=1011720
9ae3a8
9ae3a8
>From commit ID:
9ae3a8
commit bd2fa51fcdba3408f308df1b08fae04053ecdee5
9ae3a8
Author: Michael R. Hines <mrhines@us.ibm.com>
9ae3a8
Date:   Tue Jun 25 21:35:34 2013 -0400
9ae3a8
9ae3a8
    rdma: introduce qemu_ram_foreach_block()
9ae3a8
9ae3a8
    This is used during RDMA initialization in order to
9ae3a8
    transmit a description of all the RAM blocks to the
9ae3a8
    peer for later dynamic chunk registration purposes.
9ae3a8
9ae3a8
    Reviewed-by: Juan Quintela <quintela@redhat.com>
9ae3a8
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
    Reviewed-by: Chegu Vinod <chegu_vinod@hp.com>
9ae3a8
    Tested-by: Chegu Vinod <chegu_vinod@hp.com>
9ae3a8
    Tested-by: Michael R. Hines <mrhines@us.ibm.com>
9ae3a8
    Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
9ae3a8
    Signed-off-by: Juan Quintela <quintela@redhat.com>
9ae3a8
---
9ae3a8
 exec.c                    |    9 +++++++++
9ae3a8
 include/exec/cpu-common.h |    5 +++++
9ae3a8
 2 files changed, 14 insertions(+), 0 deletions(-)
9ae3a8
9ae3a8
Signed-off-by: Michal Novotny <minovotn@redhat.com>
9ae3a8
---
9ae3a8
 exec.c                    | 9 +++++++++
9ae3a8
 include/exec/cpu-common.h | 5 +++++
9ae3a8
 2 files changed, 14 insertions(+)
9ae3a8
9ae3a8
diff --git a/exec.c b/exec.c
9ae3a8
index cb11571..64af205 100644
9ae3a8
--- a/exec.c
9ae3a8
+++ b/exec.c
9ae3a8
@@ -2644,3 +2644,12 @@ bool cpu_physical_memory_is_io(hwaddr phys_addr)
9ae3a8
              memory_region_is_romd(section->mr));
9ae3a8
 }
9ae3a8
 #endif
9ae3a8
+
9ae3a8
+void qemu_ram_foreach_block(RAMBlockIterFunc func, void *opaque)
9ae3a8
+{
9ae3a8
+    RAMBlock *block;
9ae3a8
+
9ae3a8
+    QTAILQ_FOREACH(block, &ram_list.blocks, next) {
9ae3a8
+        func(block->host, block->offset, block->length, opaque);
9ae3a8
+    }
9ae3a8
+}
9ae3a8
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
9ae3a8
index 2e5f11f..2900fd6 100644
9ae3a8
--- a/include/exec/cpu-common.h
9ae3a8
+++ b/include/exec/cpu-common.h
9ae3a8
@@ -119,6 +119,11 @@ extern struct MemoryRegion io_mem_rom;
9ae3a8
 extern struct MemoryRegion io_mem_unassigned;
9ae3a8
 extern struct MemoryRegion io_mem_notdirty;
9ae3a8
 
9ae3a8
+typedef void (RAMBlockIterFunc)(void *host_addr,
9ae3a8
+    ram_addr_t offset, ram_addr_t length, void *opaque);
9ae3a8
+
9ae3a8
+void qemu_ram_foreach_block(RAMBlockIterFunc func, void *opaque);
9ae3a8
+
9ae3a8
 #endif
9ae3a8
 
9ae3a8
 #endif /* !CPU_COMMON_H */
9ae3a8
-- 
9ae3a8
1.7.11.7
9ae3a8