aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-09-27 15:00:38 +0200
committerAvi Kivity <avi@redhat.com>2011-10-02 16:27:14 +0200
commit066318109fa2f377e5097f115a23f85c53f1a674 (patch)
treeb616a56b2401473e7ad278baf2c526a493af1420
parent4b474ba7a1a96aabcf3482eb5b23ad5361a38750 (diff)
memory: Do not print empty PIO root
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--memory.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/memory.c b/memory.c
index eae67be453..19f1d36bd4 100644
--- a/memory.c
+++ b/memory.c
@@ -1360,7 +1360,10 @@ void mtree_info(fprintf_function mon_printf, void *f)
g_free(ml2);
}
- QTAILQ_INIT(&ml_head);
- mon_printf(f, "I/O\n");
- mtree_print_mr(mon_printf, f, address_space_io.root, 0, 0, &ml_head);
+ if (address_space_io.root &&
+ !QTAILQ_EMPTY(&address_space_io.root->subregions)) {
+ QTAILQ_INIT(&ml_head);
+ mon_printf(f, "I/O\n");
+ mtree_print_mr(mon_printf, f, address_space_io.root, 0, 0, &ml_head);
+ }
}