From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53675 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNf7c-0002OT-7W for qemu-devel@nongnu.org; Wed, 01 Dec 2010 00:21:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNMtP-0006IB-N6 for qemu-devel@nongnu.org; Tue, 30 Nov 2010 04:53:00 -0500 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:44986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNMtP-0006GG-5g for qemu-devel@nongnu.org; Tue, 30 Nov 2010 04:52:59 -0500 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp04.au.ibm.com (8.14.4/8.13.1) with ESMTP id oAU9lmE2031905 for ; Tue, 30 Nov 2010 20:47:48 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oAU9qonS1482842 for ; Tue, 30 Nov 2010 20:52:50 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oAU9qoQe002564 for ; Tue, 30 Nov 2010 20:52:50 +1100 Received: from sancgarg.in.ibm.com ([9.124.35.55]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id oAU9qnoB002556 for ; Tue, 30 Nov 2010 20:52:49 +1100 From: Sanchit Garg Date: Tue, 30 Nov 2010 15:22:48 +0530 Message-ID: <20101130095248.8514.75180.stgit@sancgarg.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] Convert fprintf() to error_request(): virtio-9p List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Sanchit Garg --- hw/virtio-9p.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c index 7c59988..d64d05a 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -18,6 +18,7 @@ #include "fsdev/qemu-fsdev.h" #include "virtio-9p-debug.h" #include "virtio-9p-xattr.h" +#include "qemu-error.h" int debug_9p_pdu; @@ -388,8 +389,8 @@ v9fs_string_alloc_printf(char **strp, const char *fmt, va_list ap) len += 1; break; default: - fprintf(stderr, - "v9fs_string_alloc_printf:Incorrect format %c", *iter); + error_report( + "v9fs_string_alloc_printf:Incorrect format %c", *iter); return -1; } iter++; @@ -3677,15 +3678,15 @@ VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf) if (!fse) { /* We don't have a fsdev identified by fsdev_id */ - fprintf(stderr, "Virtio-9p device couldn't find fsdev with the " - "id = %s\n", conf->fsdev_id ? conf->fsdev_id : "NULL"); + error_report("Virtio-9p device couldn't find fsdev with the " + "id = %s", conf->fsdev_id ? conf->fsdev_id : "NULL"); exit(1); } if (!fse->path || !conf->tag) { /* we haven't specified a mount_tag or the path */ - fprintf(stderr, "fsdev with id %s needs path " - "and Virtio-9p device needs mount_tag arguments\n", + error_report("fsdev with id %s needs path " + "and Virtio-9p device needs mount_tag arguments", conf->fsdev_id); exit(1); } @@ -3707,19 +3708,19 @@ VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf) s->ctx.fs_sm = SM_NONE; s->ctx.xops = none_xattr_ops; } else { - fprintf(stderr, "Default to security_model=none. You may want" + error_report("Default to security_model=none. You may want" " enable advanced security model using " "security option:\n\t security_model=passthrough \n\t " - "security_model=mapped\n"); + "security_model=mapped"); s->ctx.fs_sm = SM_NONE; s->ctx.xops = none_xattr_ops; } if (lstat(fse->path, &stat)) { - fprintf(stderr, "share path %s does not exist\n", fse->path); + error_report("share path %s does not exist", fse->path); exit(1); } else if (!S_ISDIR(stat.st_mode)) { - fprintf(stderr, "share path %s is not a directory \n", fse->path); + error_report("share path %s is not a directory", fse->path); exit(1); }