@@ -640,7 +640,7 @@ const PropertyInfo qdev_prop_arraylen = {
/* --- public helpers --- */
-static Property *qdev_prop_walk(Property *props, const char *name)
+static const Property *qdev_prop_walk(const Property *props, const char *name)
{
if (!props) {
return NULL;
@@ -654,10 +654,10 @@ static Property *qdev_prop_walk(Property *props, const char *name)
return NULL;
}
-static Property *qdev_prop_find(DeviceState *dev, const char *name)
+static const Property *qdev_prop_find(DeviceState *dev, const char *name)
{
ObjectClass *class;
- Property *prop;
+ const Property *prop;
/* device properties */
class = object_get_class(OBJECT(dev));
@@ -731,7 +731,7 @@ void qdev_prop_set_string(DeviceState *dev, const char *name, const char *value)
void qdev_prop_set_enum(DeviceState *dev, const char *name, int value)
{
- Property *prop;
+ const Property *prop;
prop = qdev_prop_find(dev, name);
object_property_set_str(OBJECT(dev), name,
@@ -959,7 +959,7 @@ void device_class_set_props(DeviceClass *dc, Property *props)
void qdev_alias_all_properties(DeviceState *target, Object *source)
{
ObjectClass *class;
- Property *prop;
+ const Property *prop;
class = object_get_class(OBJECT(target));
do {
@@ -108,7 +108,7 @@ struct DeviceClass {
* The underscore at the end ensures a compile-time error if someone
* assigns to dc->props instead of using device_class_set_props.
*/
- Property *props_;
+ const Property *props_;
/*
* Can this device be instantiated with -device / device_add?
@@ -741,8 +741,8 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp)
#define qdev_printf(fmt, ...) monitor_printf(mon, "%*s" fmt, indent, "", ## __VA_ARGS__)
static void qbus_print(Monitor *mon, BusState *bus, int indent);
-static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props,
- int indent)
+static void qdev_print_props(Monitor *mon, DeviceState *dev,
+ const Property *props, int indent)
{
if (!props)
return;
The pointed Property structure is accessed read-only. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/core/qdev-properties.c | 10 +++++----- include/hw/qdev-core.h | 2 +- softmmu/qdev-monitor.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-)