[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/7] hw/misc/empty_slot: Add a 'name' qdev property
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 4/7] hw/misc/empty_slot: Add a 'name' qdev property |
Date: |
Sun, 10 May 2020 17:28:37 +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é <address@hidden>
---
hw/core/empty_slot.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
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(),
};
--
2.21.3
- [PATCH 0/7] hw/misc/empty_slot: Spring cleaning, Philippe Mathieu-Daudé, 2020/05/10
- [PATCH 1/7] hw/sparc/sun4m: Use UnimplementedDevice for I/O devices, Philippe Mathieu-Daudé, 2020/05/10
- [PATCH 2/7] hw/misc/empty_slot: Lower address space priority, Philippe Mathieu-Daudé, 2020/05/10
- [PATCH 3/7] hw/misc/empty_slot: Convert 'size' field as qdev property, Philippe Mathieu-Daudé, 2020/05/10
- [PATCH 4/7] hw/misc/empty_slot: Add a 'name' qdev property,
Philippe Mathieu-Daudé <=
- [PATCH 5/7] hw/misc/empty_slot: Convert debug printf() to trace event, Philippe Mathieu-Daudé, 2020/05/10
- [PATCH 6/7] hw/misc/empty_slot: Move the 'hw/misc' and cover in MAINTAINERS, Philippe Mathieu-Daudé, 2020/05/10
- [PATCH 7/7] hw/misc/empty_slot: Name the slots when created, Philippe Mathieu-Daudé, 2020/05/10
- Re: [PATCH 0/7] hw/misc/empty_slot: Spring cleaning, Philippe Mathieu-Daudé, 2020/05/24