aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-01-18 17:40:50 +0000
committerPeter Maydell <peter.maydell@linaro.org>2016-01-18 17:40:50 +0000
commit3db34bf64ab4f8797565dd8750003156c32b301d (patch)
treeb4b660b22b17d76c7184e3d153f5c6c2e0681925 /hw
parent12b167226f2804063cf8d72fe4fdc01764c99e96 (diff)
parent300b115ce804cb6a20acc0003cc17687545b728d (diff)
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
QOM infrastructure fixes and device conversions * Dynamic class properties * Property iterator cleanup * Device hot-unplug ID race fix # gpg: Signature made Mon 18 Jan 2016 17:27:01 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-peter: MAINTAINERS: Fix sPAPR entry heading qdev: Free QemuOpts when the QOM path goes away qom: Change object property iterator API contract qom: Allow properties to be registered against classes Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/core/qdev.c4
-rw-r--r--hw/ppc/spapr_drc.c7
2 files changed, 6 insertions, 5 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 2c7101d91d..44bf790b01 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -1206,7 +1206,6 @@ static void device_finalize(Object *obj)
NamedGPIOList *ngl, *next;
DeviceState *dev = DEVICE(obj);
- qemu_opts_del(dev->opts);
QLIST_FOREACH_SAFE(ngl, &dev->gpios, node, next) {
QLIST_REMOVE(ngl, node);
@@ -1254,6 +1253,9 @@ static void device_unparent(Object *obj)
qapi_event_send_device_deleted(!!dev->id, dev->id, path, &error_abort);
g_free(path);
}
+
+ qemu_opts_del(dev->opts);
+ dev->opts = NULL;
}
static void device_class_init(ObjectClass *class, void *data)
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index 4fb86a68c4..dccb908c31 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -684,7 +684,7 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner,
{
Object *root_container;
ObjectProperty *prop;
- ObjectPropertyIterator *iter;
+ ObjectPropertyIterator iter;
uint32_t drc_count = 0;
GArray *drc_indexes, *drc_power_domains;
GString *drc_names, *drc_types;
@@ -708,8 +708,8 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner,
*/
root_container = container_get(object_get_root(), DRC_CONTAINER_PATH);
- iter = object_property_iter_init(root_container);
- while ((prop = object_property_iter_next(iter))) {
+ object_property_iter_init(&iter, root_container);
+ while ((prop = object_property_iter_next(&iter))) {
Object *obj;
sPAPRDRConnector *drc;
sPAPRDRConnectorClass *drck;
@@ -750,7 +750,6 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner,
spapr_drc_get_type_str(drc->type));
drc_types = g_string_insert_len(drc_types, -1, "\0", 1);
}
- object_property_iter_free(iter);
/* now write the drc count into the space we reserved at the
* beginning of the arrays previously