]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
qmp: report path ambiguity error
authorMichael Tokarev <mjt@tls.msk.ru>
Sun, 4 May 2014 08:23:59 +0000 (12:23 +0400)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 7 May 2014 17:00:43 +0000 (21:00 +0400)
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>
qmp.c

diff --git a/qmp.c b/qmp.c
index c4836dfb6ccca449b9fd8d79278c38f5d6c31461..233325dd7ebce44cb21dce356cbf9e05dd954235 100644 (file)
--- 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;
     }