diff options
Diffstat (limited to 'hw/core/qdev-properties.c')
-rw-r--r-- | hw/core/qdev-properties.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 9075453f2d..66556d3bf9 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -961,13 +961,29 @@ int qdev_prop_check_globals(void) int ret = 0; QTAILQ_FOREACH(prop, &global_props, next) { - if (!prop->not_used) { + ObjectClass *oc; + DeviceClass *dc; + if (prop->used) { + continue; + } + if (!prop->user_provided) { + continue; + } + oc = object_class_by_name(prop->driver); + oc = object_class_dynamic_cast(oc, TYPE_DEVICE); + if (!oc) { + error_report("Warning: global %s.%s has invalid class name", + prop->driver, prop->property); + ret = 1; + continue; + } + dc = DEVICE_CLASS(oc); + if (!dc->hotpluggable && !prop->used) { + error_report("Warning: global %s.%s=%s not used", + prop->driver, prop->property, prop->value); + ret = 1; continue; } - ret = 1; - error_report("Warning: \"-global %s.%s=%s\" not used", - prop->driver, prop->property, prop->value); - } return ret; } @@ -983,7 +999,7 @@ void qdev_prop_set_globals_for_type(DeviceState *dev, const char *typename, if (strcmp(typename, prop->driver) != 0) { continue; } - prop->not_used = false; + prop->used = true; object_property_parse(OBJECT(dev), prop->value, prop->property, &err); if (err != NULL) { error_propagate(errp, err); |