qdev: add monitor command to dump the tree.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Paul Brook <paul@codesourcery.com>
This commit is contained in:
Gerd Hoffmann 2009-06-05 15:53:17 +01:00 committed by Paul Brook
parent 1431b6a17e
commit cae4956e5e
4 changed files with 93 additions and 0 deletions

View file

@ -20,6 +20,7 @@
#include "sysbus.h"
#include "sysemu.h"
#include "monitor.h"
void sysbus_connect_irq(SysBusDevice *dev, int n, qemu_irq irq)
{
@ -150,3 +151,14 @@ DeviceState *sysbus_create_varargs(const char *name,
}
return dev;
}
void sysbus_dev_print(Monitor *mon, DeviceState *dev, int indent)
{
SysBusDevice *s = sysbus_from_qdev(dev);
int i;
for (i = 0; i < s->num_mmio; i++) {
monitor_printf(mon, "%*smmio " TARGET_FMT_plx "/" TARGET_FMT_plx "\n",
indent, "", s->mmio[i].addr, s->mmio[i].size);
}
}