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: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
a22f8f3894
commit
797720876a
6
qmp.c
6
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user