qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-trivial] [PULL 18/22] qmp: report path ambiguity error


From: Michael Tokarev
Subject: [Qemu-trivial] [PULL 18/22] qmp: report path ambiguity error
Date: Mon, 5 May 2014 22:01:59 +0400

Without this, ambiguous path is reported to the user as
"not found", which is confusing at least.

Signed-off-by: Michael Tokarev <address@hidden>
---
 qmp.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/qmp.c b/qmp.c
index 74107be..37bd7dc 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;
     }
 
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]