Commit 79772087 authored by Michael Tokarev's avatar Michael Tokarev

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: default avatarMichael Tokarev <mjt@tls.msk.ru>
parent a22f8f38
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment