]> Git Repo - qemu.git/commitdiff
hw/misc/empty_slot: Add a 'name' qdev property
authorPhilippe Mathieu-Daudé <[email protected]>
Mon, 24 Jun 2019 15:23:31 +0000 (17:23 +0200)
committerPhilippe Mathieu-Daudé <[email protected]>
Tue, 9 Jun 2020 04:59:44 +0000 (06:59 +0200)
Add a 'name' qdev property so when multiple slots are
accessed, we can notice which one is accessed.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Acked-by: Artyom Tarasenko <[email protected]>
Message-Id: <20200510152840[email protected]>

hw/core/empty_slot.c

index 0df086fe9890e7ac432e72726d9538d0632ab08a..576b276c4ba54eaa582df781de26e776fde3f1cf 100644 (file)
@@ -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(),
 };
 
This page took 0.027473 seconds and 4 git commands to generate.