summary refs log tree commit diff stats
path: root/hw
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2019-06-24 17:23:31 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-06-09 06:59:44 +0200
commit07ddf5cbe2e9499cc2d238e5c864ac3f5bdd25ce (patch)
treea792eb8b7793f438467e21fcfbb7e952f0de680e /hw
parent4bbadef0e3da3f455374e83cb9249c2afe497b24 (diff)
downloadfocaccia-qemu-07ddf5cbe2e9499cc2d238e5c864ac3f5bdd25ce.tar.gz
focaccia-qemu-07ddf5cbe2e9499cc2d238e5c864ac3f5bdd25ce.zip
hw/misc/empty_slot: Add a 'name' qdev property
Add a 'name' qdev property so when multiple slots are
accessed, we can notice which one is accessed.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>
Message-Id: <20200510152840.13558-5-f4bug@amsat.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/core/empty_slot.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/core/empty_slot.c b/hw/core/empty_slot.c
index 0df086fe98..576b276c4b 100644
--- a/hw/core/empty_slot.c
+++ b/hw/core/empty_slot.c
@@ -31,6 +31,7 @@ typedef struct EmptySlot {
     SysBusDevice parent_obj;
 
     MemoryRegion iomem;
+    char *name;
     uint64_t size;
 } EmptySlot;
 
@@ -72,13 +73,17 @@ static void empty_slot_realize(DeviceState *dev, Error **errp)
 {
     EmptySlot *s = EMPTY_SLOT(dev);
 
+    if (s->name == NULL) {
+        s->name = g_strdup("empty-slot");
+    }
     memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s,
-                          "empty-slot", s->size);
+                          s->name, s->size);
     sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
 }
 
 static Property empty_slot_properties[] = {
     DEFINE_PROP_UINT64("size", EmptySlot, size, 0),
+    DEFINE_PROP_STRING("name", EmptySlot, name),
     DEFINE_PROP_END_OF_LIST(),
 };