diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-04 11:17:51 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:39 -0600 |
commit | f79f2bfc6aae76718652f0b3e15a849f7b58104a (patch) | |
tree | be827c0b6a7ff5e2a521fd5d604773e8f079413c /hw/qdev-properties.c | |
parent | 30fbb9fc7cd73abc32ff71ceb59e9a3be37ac128 (diff) |
qdev: don't access name through info
We already have a QOM interface for this so let's use it.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/qdev-properties.c')
-rw-r--r-- | hw/qdev-properties.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index d71dfdafaf..c98219ad26 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -989,16 +989,16 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev, switch (ret) { case -EEXIST: error_set(errp, QERR_PROPERTY_VALUE_IN_USE, - qdev_get_info(dev)->name, prop->name, value); + object_get_typename(OBJECT(dev)), prop->name, value); break; default: case -EINVAL: error_set(errp, QERR_PROPERTY_VALUE_BAD, - qdev_get_info(dev)->name, prop->name, value); + object_get_typename(OBJECT(dev)), prop->name, value); break; case -ENOENT: error_set(errp, QERR_PROPERTY_VALUE_NOT_FOUND, - qdev_get_info(dev)->name, prop->name, value); + object_get_typename(OBJECT(dev)), prop->name, value); break; case 0: break; @@ -1018,7 +1018,7 @@ int qdev_prop_parse(DeviceState *dev, const char *name, const char *value) * removed along with it. */ if (!prop || !prop->info->parse) { - qerror_report(QERR_PROPERTY_NOT_FOUND, qdev_get_info(dev)->name, name); + qerror_report(QERR_PROPERTY_NOT_FOUND, object_get_typename(OBJECT(dev)), name); return -1; } ret = prop->info->parse(dev, prop, value); @@ -1039,12 +1039,12 @@ void qdev_prop_set(DeviceState *dev, const char *name, void *src, enum PropertyT prop = qdev_prop_find(dev, name); if (!prop) { fprintf(stderr, "%s: property \"%s.%s\" not found\n", - __FUNCTION__, qdev_get_info(dev)->name, name); + __FUNCTION__, object_get_typename(OBJECT(dev)), name); abort(); } if (prop->info->type != type) { fprintf(stderr, "%s: property \"%s.%s\" type mismatch\n", - __FUNCTION__, qdev_get_info(dev)->name, name); + __FUNCTION__, object_get_typename(OBJECT(dev)), name); abort(); } qdev_prop_cpy(dev, prop, src); @@ -1093,7 +1093,7 @@ int qdev_prop_set_drive(DeviceState *dev, const char *name, BlockDriverState *va if (res < 0) { error_report("Can't attach drive %s to %s.%s: %s", bdrv_get_device_name(value), - dev->id ? dev->id : qdev_get_info(dev)->name, + dev->id ? dev->id : object_get_typename(OBJECT(dev)), name, strerror(-res)); return -1; } @@ -1165,7 +1165,7 @@ void qdev_prop_set_globals(DeviceState *dev) GlobalProperty *prop; QTAILQ_FOREACH(prop, &global_props, next) { - if (strcmp(qdev_get_info(dev)->name, prop->driver) != 0 && + if (strcmp(object_get_typename(OBJECT(dev)), prop->driver) != 0 && strcmp(qdev_get_info(dev)->bus_info->name, prop->driver) != 0) { continue; } |