From patchwork Tue Feb 7 14:09:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 139942 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 7EB15B7227 for ; Wed, 8 Feb 2012 01:28:11 +1100 (EST) Received: from localhost ([::1]:38938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RulkF-0001s8-QY for incoming@patchwork.ozlabs.org; Tue, 07 Feb 2012 09:10:07 -0500 Received: from eggs.gnu.org ([140.186.70.92]:53932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruljr-0001V0-01 for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ruljg-0005gU-9b for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:42 -0500 Received: from oxygen.pond.sub.org ([78.46.104.156]:39187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruljg-0005eV-4N 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 63289A43FE; Tue, 7 Feb 2012 15:09:31 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 500) id A644B60091; Tue, 7 Feb 2012 15:09:27 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 7 Feb 2012 15:09:23 +0100 Message-Id: <1328623766-12287-17-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 16/19] spice-qemu-char: Chardev open error reporting, spicevmc 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(). Signed-off-by: Markus Armbruster --- spice-qemu-char.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spice-qemu-char.c b/spice-qemu-char.c index 1e735ff..290437d 100644 --- a/spice-qemu-char.c +++ b/spice-qemu-char.c @@ -176,16 +176,16 @@ static void print_allowed_subtypes(void) const char** psubtype; int i; - fprintf(stderr, "allowed names: "); + error_printf("allowed names: "); for(i=0, psubtype = spice_server_char_device_recognized_subtypes(); *psubtype != NULL; ++psubtype, ++i) { if (i == 0) { - fprintf(stderr, "%s", *psubtype); + error_printf("%s", *psubtype); } else { - fprintf(stderr, ", %s", *psubtype); + error_printf(", %s", *psubtype); } } - fprintf(stderr, "\n"); + error_printf("\n"); } CharDriverState *qemu_chr_open_spice(QemuOpts *opts) @@ -198,7 +198,7 @@ CharDriverState *qemu_chr_open_spice(QemuOpts *opts) const char *subtype = NULL; if (name == NULL) { - fprintf(stderr, "spice-qemu-char: missing name parameter\n"); + error_report("spicevmc character device requires parameter name"); print_allowed_subtypes(); return NULL; } @@ -209,7 +209,7 @@ CharDriverState *qemu_chr_open_spice(QemuOpts *opts) } } if (subtype == NULL) { - fprintf(stderr, "spice-qemu-char: unsupported name\n"); + error_report("name '%s' is not supported", name); print_allowed_subtypes(); return NULL; }