From patchwork Tue Feb 7 14:09:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 139955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2140B1007D3 for ; Wed, 8 Feb 2012 02:35:41 +1100 (EST) Received: from localhost ([::1]:33813 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rulkr-0002du-Cs for incoming@patchwork.ozlabs.org; Tue, 07 Feb 2012 09:10:45 -0500 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 Received: from blackfin.pond.sub.org (p5B32D218.dip.t-dialin.net [91.50.210.24]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 6EFAEA4400; Tue, 7 Feb 2012 15:09:31 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 500) id B2A326008F; Tue, 7 Feb 2012 15:09:27 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 7 Feb 2012 15:09:24 +0100 Message-Id: <1328623766-12287-18-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.6.5 In-Reply-To: <1328623766-12287-1-git-send-email-armbru@redhat.com> References: <1328623766-12287-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 78.46.104.156 Cc: kwolf@redhat.com, aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH 17/19] baum: Chardev open error reporting, braille part X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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; }