From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54837 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNr02-00048u-Qv for qemu-devel@nongnu.org; Wed, 01 Dec 2010 13:01:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNr01-0000it-Lw for qemu-devel@nongnu.org; Wed, 01 Dec 2010 13:01:50 -0500 Received: from e39.co.us.ibm.com ([32.97.110.160]:33323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNr01-0000iY-Fm for qemu-devel@nongnu.org; Wed, 01 Dec 2010 13:01:49 -0500 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e39.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id oB1HoDIC002432 for ; Wed, 1 Dec 2010 10:50:13 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oB1I1eEW152322 for ; Wed, 1 Dec 2010 11:01:40 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oB1I1dv4002955 for ; Wed, 1 Dec 2010 11:01:40 -0700 Message-ID: <4CF68D82.7070507@linux.vnet.ibm.com> Date: Wed, 01 Dec 2010 10:01:38 -0800 From: "Venkateswararao Jujjuri (JV)" MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Convert fprintf() to error_request(): virtio-9p References: <20101130095248.8514.75180.stgit@sancgarg.in.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Sanchit Garg , qemu-devel@nongnu.org On 12/1/2010 1:35 AM, Stefan Hajnoczi wrote: > On Tue, Nov 30, 2010 at 9:52 AM, Sanchit Garg > wrote: >> @@ -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; >> } > > It would be safer to avoid embedded \n\t. Although I can't find > anything prohibiting it in the source, no other place does this. > Program output is easier to handle when constrained to one message per > line. Security issues arise when unfiltered inputs are logged *and* > linebreaks are allowed because malicious input can inject fake log > lines. Let's avoid getting into the habit. Embedded breaks were introduced to give more readable and formatted output. Stafan do you suggest to print the entire message in one line? - JV > > Looks good otherwise. > > Stefan >