Received: from eggs.gnu.org ([2001:4830:134:3::10]:49603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhNLX-000579-Qs for qemu-devel@nongnu.org; Mon, 05 May 2014 14:10:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WhNLK-0003hx-TG for qemu-devel@nongnu.org; Mon, 05 May 2014 14:10:35 -0400 From: Michael Tokarev Date: Mon, 5 May 2014 22:01:59 +0400 Message-Id: <1399312923-24129-19-git-send-email-mjt@msgid.tls.msk.ru> In-Reply-To: <1399312923-24129-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1399312923-24129-1-git-send-email-mjt@msgid.tls.msk.ru> Subject: [Qemu-devel] [PULL 18/22] qmp: report path ambiguity error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev 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