Skip to content

Commit

Permalink
qmp: report path ambiguity error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Tokarev committed May 7, 2014
1 parent a22f8f3 commit 7977208
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qmp.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7977208

Please sign in to comment.