[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 01/16] memory: Allow subregions to not be printed
From: |
Alistair Francis |
Subject: |
[Qemu-devel] [PATCH v4 01/16] memory: Allow subregions to not be printed by info mtree |
Date: |
Tue, 9 Feb 2016 14:14:39 -0800 |
Add a function called memory_region_add_subregion_no_print() that
creates memory subregions that won't be printed when running
the 'info mtree' command.
Signed-off-by: Alistair Francis <address@hidden>
Reviewed-by: KONRAD Frederic <address@hidden>
---
include/exec/memory.h | 17 +++++++++++++++++
memory.c | 10 +++++++++-
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index c92734a..25353df 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -186,6 +186,7 @@ struct MemoryRegion {
bool skip_dump;
bool enabled;
bool warning_printed; /* For reservations */
+ bool do_not_print;
uint8_t vga_logging_count;
MemoryRegion *alias;
hwaddr alias_offset;
@@ -954,6 +955,22 @@ void memory_region_del_eventfd(MemoryRegion *mr,
void memory_region_add_subregion(MemoryRegion *mr,
hwaddr offset,
MemoryRegion *subregion);
+
+/**
+ * memory_region_add_subregion_no_print: Add a subregion to a container.
+ *
+ * The same functionality as memory_region_add_subregion except that any
+ * memory regions added by this function are not printed by 'info mtree'.
+ *
+ * @mr: the region to contain the new subregion; must be a container
+ * initialized with memory_region_init().
+ * @offset: the offset relative to @mr where @subregion is added.
+ * @subregion: the subregion to be added.
+ */
+void memory_region_add_subregion_no_print(MemoryRegion *mr,
+ hwaddr offset,
+ MemoryRegion *subregion);
+
/**
* memory_region_add_subregion_overlap: Add a subregion to a container
* with overlap.
diff --git a/memory.c b/memory.c
index 09041ed..228a8a7 100644
--- a/memory.c
+++ b/memory.c
@@ -1829,6 +1829,14 @@ void memory_region_add_subregion(MemoryRegion *mr,
memory_region_add_subregion_common(mr, offset, subregion);
}
+void memory_region_add_subregion_no_print(MemoryRegion *mr,
+ hwaddr offset,
+ MemoryRegion *subregion)
+{
+ memory_region_add_subregion(mr, offset, subregion);
+ subregion->do_not_print = true;
+}
+
void memory_region_add_subregion_overlap(MemoryRegion *mr,
hwaddr offset,
MemoryRegion *subregion,
@@ -2219,7 +2227,7 @@ static void mtree_print_mr(fprintf_function mon_printf,
void *f,
const MemoryRegion *submr;
unsigned int i;
- if (!mr) {
+ if (!mr || mr->do_not_print) {
return;
}
--
2.5.0
- [Qemu-devel] [PATCH v4 00/16] data-driven device registers, Alistair Francis, 2016/02/09
- [Qemu-devel] [PATCH v4 01/16] memory: Allow subregions to not be printed by info mtree,
Alistair Francis <=
- [Qemu-devel] [PATCH v4 02/16] register: Add Register API, Alistair Francis, 2016/02/09
- [Qemu-devel] [PATCH v4 03/16] register: Add Memory API glue, Alistair Francis, 2016/02/09
- [Qemu-devel] [PATCH v4 04/16] register: Add support for decoding information, Alistair Francis, 2016/02/09
- [Qemu-devel] [PATCH v4 06/16] register: QOMify, Alistair Francis, 2016/02/09
- [Qemu-devel] [PATCH v4 05/16] register: Define REG and FIELD macros, Alistair Francis, 2016/02/09
- [Qemu-devel] [PATCH v4 07/16] register: Add block initialise helper, Alistair Francis, 2016/02/09