From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruljs-0001V5-4h for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ruljg-0005gk-E4 for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:44 -0500 Received: from oxygen.pond.sub.org ([78.46.104.156]:39188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruljg-0005eU-80 for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:32 -0500 From: Markus Armbruster Date: Tue, 7 Feb 2012 15:09:24 +0100 Message-Id: <1328623766-12287-18-git-send-email-armbru@redhat.com> In-Reply-To: <1328623766-12287-1-git-send-email-armbru@redhat.com> References: <1328623766-12287-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 17/19] baum: Chardev open error reporting, braille part List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, aliguori@us.ibm.com Convert to error_report(). Improves user-hostile messages like this one baum_init: brlapi_openConnection: connect: No such file or directory chardev: opening backend "braille" failed to qemu-system-x86_64: -chardev braille,id=foo: Can't open braille: connect: No such file or directory chardev: opening backend "braille" failed The uninformative extra "opening backend failed" message will be cleaned up shortly. Signed-off-by: Markus Armbruster --- hw/baum.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/baum.c b/hw/baum.c index 3e94f84..7453a15 100644 --- a/hw/baum.c +++ b/hw/baum.c @@ -585,14 +585,16 @@ CharDriverState *chr_baum_init(QemuOpts *opts) baum->brlapi_fd = brlapi__openConnection(handle, NULL, NULL); if (baum->brlapi_fd == -1) { - brlapi_perror("baum_init: brlapi_openConnection"); + error_report("Can't open braille: %s", + brlapi_strerror(&brlapi_error)); goto fail_handle; } baum->cellCount_timer = qemu_new_timer_ns(vm_clock, baum_cellCount_timer_cb, baum); if (brlapi__getDisplaySize(handle, &baum->x, &baum->y) == -1) { - brlapi_perror("baum_init: brlapi_getDisplaySize"); + error_report("Can't get braille display size: %s", + brlapi_strerror(&brlapi_error)); goto fail; } @@ -606,7 +608,8 @@ CharDriverState *chr_baum_init(QemuOpts *opts) tty = BRLAPI_TTY_DEFAULT; if (brlapi__enterTtyMode(handle, tty, NULL) == -1) { - brlapi_perror("baum_init: brlapi_enterTtyMode"); + error_report("Can't configure braille: %s", + brlapi_strerror(&brlapi_error)); goto fail; } -- 1.7.6.5