summaryrefslogtreecommitdiff
path: root/hw/core/qdev-properties-system.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/core/qdev-properties-system.c')
-rw-r--r--hw/core/qdev-properties-system.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 404cf1843d..de433b2e38 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -439,11 +439,27 @@ PropertyInfo qdev_prop_iothread = {
static int qdev_add_one_global(QemuOpts *opts, void *opaque)
{
GlobalProperty *g;
+ ObjectClass *oc;
g = g_malloc0(sizeof(*g));
g->driver = qemu_opt_get(opts, "driver");
g->property = qemu_opt_get(opts, "property");
g->value = qemu_opt_get(opts, "value");
+ oc = object_class_by_name(g->driver);
+ if (oc) {
+ DeviceClass *dc = DEVICE_CLASS(oc);
+
+ if (dc->hotpluggable) {
+ /* If hotpluggable then skip not_used checking. */
+ g->not_used = false;
+ } else {
+ /* Maybe a typo. */
+ g->not_used = true;
+ }
+ } else {
+ /* Maybe a typo. */
+ g->not_used = true;
+ }
qdev_prop_register_global(g);
return 0;
}