aboutsummaryrefslogtreecommitdiff
path: root/qom/qom-hmp-cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'qom/qom-hmp-cmds.c')
-rw-r--r--qom/qom-hmp-cmds.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/qom/qom-hmp-cmds.c b/qom/qom-hmp-cmds.c
index a8b0a080c7..f704b6949a 100644
--- a/qom/qom-hmp-cmds.c
+++ b/qom/qom-hmp-cmds.c
@@ -48,19 +48,13 @@ void hmp_qom_set(Monitor *mon, const QDict *qdict)
const char *property = qdict_get_str(qdict, "property");
const char *value = qdict_get_str(qdict, "value");
Error *err = NULL;
- bool ambiguous = false;
- Object *obj;
+ QObject *obj;
- obj = object_resolve_path(path, &ambiguous);
- if (obj == NULL) {
- error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND,
- "Device '%s' not found", path);
- } else {
- if (ambiguous) {
- monitor_printf(mon, "Warning: Path '%s' is ambiguous\n", path);
- }
- object_property_parse(obj, value, property, &err);
+ obj = qobject_from_json(value, &err);
+ if (err == NULL) {
+ qmp_qom_set(path, property, obj, &err);
}
+
hmp_handle_error(mon, err);
}