Received: from eggs.gnu.org ([2001:4830:134:3::10]:57518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhFQg-0005Qk-44 for qemu-devel@nongnu.org; Mon, 05 May 2014 05:43:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WhFQb-0006dm-5i for qemu-devel@nongnu.org; Mon, 05 May 2014 05:43:22 -0400 From: Michael Tokarev Date: Sun, 4 May 2014 12:23:59 +0400 Message-Id: <1399282993.052701.9438.nullmailer@msgid.tls.msk.ru> Subject: [Qemu-devel] [PATCH v3] qmp: report path ambiguity error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-trivial@nongnu.org Cc: qemu-devel@nongnu.org Without this, ambiguous path is reported to the user as "not found", which is confusing at least. Signed-off-by: Michael Tokarev --- 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