]> git.proxmox.com Git - qemu.git/commitdiff
memory: Do not print empty PIO root
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 27 Sep 2011 13:00:38 +0000 (15:00 +0200)
committerAvi Kivity <avi@redhat.com>
Sun, 2 Oct 2011 14:27:14 +0000 (16:27 +0200)
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
memory.c

index eae67be453f1fc778d20061de122efaacce34676..19f1d36bd4ad0a7f7ef6735fe40c4e8bbee493ae 100644 (file)
--- 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);
+    }
 }