summaryrefslogtreecommitdiff
path: root/qmp.c
diff options
context:
space:
mode:
authorMichael Tokarev <mjt@tls.msk.ru>2014-05-04 12:23:59 +0400
committerMichael Tokarev <mjt@tls.msk.ru>2014-05-07 21:00:43 +0400
commit797720876a5c24dd6adb3c2d6e0c872ac3b35c11 (patch)
tree10d8dee31f9b67c47d3955e2c8809e18215d724c /qmp.c
parenta22f8f38942623dc473bf5ced5b4117b8bdf4821 (diff)
downloadqemu-797720876a5c24dd6adb3c2d6e0c872ac3b35c11.tar.gz
qemu-797720876a5c24dd6adb3c2d6e0c872ac3b35c11.tar.bz2
qemu-797720876a5c24dd6adb3c2d6e0c872ac3b35c11.zip
qmp: report path ambiguity error
Without this, ambiguous path is reported to the user as "not found", which is confusing at least. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'qmp.c')
-rw-r--r--qmp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/qmp.c b/qmp.c
index c4836dfb6c..233325dd7e 100644
--- a/qmp.c
+++ b/qmp.c
@@ -200,7 +200,11 @@ ObjectPropertyInfoList *qmp_qom_list(const char *path, Error **errp)
obj = object_resolve_path(path, &ambiguous);
if (obj == NULL) {
- error_set(errp, QERR_DEVICE_NOT_FOUND, path);
+ if (ambiguous) {
+ error_setg(errp, "Path '%s' is ambiguous", path);
+ } else {
+ error_set(errp, QERR_DEVICE_NOT_FOUND, path);
+ }
return NULL;
}