Skip to contentSkip to conversation

qmp: report path ambiguity error

PATCH New Michael Tokarev 1 participant 1 message May 5, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 qmp: report path ambiguity error

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

---
 qmp.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
qmp.c +5 -1
index 74107be..37bd7dc 100644
@@ -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;
     }
 
Signature · 1 line
1.7.10.4