diff options
Diffstat (limited to 'qmp.c')
-rw-r--r-- | qmp.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -27,6 +27,7 @@ #include "qapi/qmp/qobject.h" #include "qapi/qmp-input-visitor.h" #include "hw/boards.h" +#include "qom/object_interfaces.h" NameInfo *qmp_query_name(Error **errp) { @@ -554,6 +555,17 @@ void object_add(const char *type, const char *id, const QDict *qdict, } } + if (!object_dynamic_cast(obj, TYPE_USER_CREATABLE)) { + error_setg(&local_err, "object '%s' isn't supported by object-add", + id); + goto out; + } + + user_creatable_complete(obj, &local_err); + if (local_err) { + goto out; + } + object_property_add_child(container_get(object_get_root(), "/objects"), id, obj, &local_err); out: |