From 73093354418602a2ff5e43cb91a21b17fbf047d8 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Wed, 25 Jan 2012 13:37:36 -0600 Subject: [PATCH] qdev: change ambiguous qdev names Reported-by: Blue Swirl Signed-off-by: Anthony Liguori --- hw/apb_pci.c | 4 ++-- hw/dec_pci.c | 2 +- hw/spapr_pci.c | 2 +- qom/object.c | 5 +++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/apb_pci.c b/hw/apb_pci.c index 173dab376f..1a45420c56 100644 --- a/hw/apb_pci.c +++ b/hw/apb_pci.c @@ -350,7 +350,7 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base, sysbus_connect_irq(s, i, pic[i]); } - pci_create_simple(d->bus, 0, "pbm"); + pci_create_simple(d->bus, 0, "pbm-pci"); /* APB secondary busses */ pci_dev = pci_create_multifunction(d->bus, PCI_DEVFN(1, 0), true, @@ -448,7 +448,7 @@ static void pbm_pci_host_class_init(ObjectClass *klass, void *data) } static DeviceInfo pbm_pci_host_info = { - .name = "pbm", + .name = "pbm-pci", .size = sizeof(PCIDevice), .class_init = pbm_pci_host_class_init, }; diff --git a/hw/dec_pci.c b/hw/dec_pci.c index f0ecaff07d..333bad98b4 100644 --- a/hw/dec_pci.c +++ b/hw/dec_pci.c @@ -131,7 +131,7 @@ static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data) } static DeviceInfo pci_dec_21154_device_info = { - .name = "dec-21154", + .name = "dec-21154-sysbus", .size = sizeof(DECState), .class_init = pci_dec_21154_device_class_init, }; diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c index b6ac0d4891..2a82eae462 100644 --- a/hw/spapr_pci.c +++ b/hw/spapr_pci.c @@ -222,7 +222,7 @@ static void spapr_main_pci_host_class_init(ObjectClass *klass, void *data) } static DeviceInfo spapr_main_pci_host_info = { - .name = "spapr-pci-host-bridge", + .name = "spapr-pci-host-bridge-pci", .size = sizeof(PCIDevice), .class_init = spapr_main_pci_host_class_init, }; diff --git a/qom/object.c b/qom/object.c index ef37e080d4..a12895fc99 100644 --- a/qom/object.c +++ b/qom/object.c @@ -87,6 +87,11 @@ TypeImpl *type_register(const TypeInfo *info) g_assert(info->name != NULL); + if (type_table_lookup(info->name) != NULL) { + fprintf(stderr, "Registering `%s' which already exists\n", info->name); + abort(); + } + ti->name = g_strdup(info->name); ti->parent = g_strdup(info->parent);