From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N2pzq-0004ul-Q0 for qemu-devel@nongnu.org; Tue, 27 Oct 2009 13:38:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N2pzo-0004uR-T9 for qemu-devel@nongnu.org; Tue, 27 Oct 2009 13:38:13 -0400 Received: from [199.232.76.173] (port=36261 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N2pzo-0004uO-P9 for qemu-devel@nongnu.org; Tue, 27 Oct 2009 13:38:12 -0400 Received: from fe01x03-cgp.akado.ru ([77.232.31.164]:50506 helo=akado.ru) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N2pzo-0003I8-9s for qemu-devel@nongnu.org; Tue, 27 Oct 2009 13:38:12 -0400 Date: Tue, 27 Oct 2009 20:38:10 +0300 (MSK) From: malc Subject: Re: [Qemu-devel] [PATCH] Improve error reporting on file access In-Reply-To: Message-ID: References: <20091001144256.GA30845@linuxtx.org> <1254413572.2920.37.camel@blaa> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Mark McLoughlin , "Justin M. Forbes" , qemu-devel@nongnu.org On Tue, 27 Oct 2009, Markus Armbruster wrote: > Mark McLoughlin writes: > > > On Thu, 2009-10-01 at 09:42 -0500, Justin M. Forbes wrote: > >> Author: Justin M. Forbes > >> Date: Thu Oct 1 09:34:56 2009 -0500 > >> > >> Improve error reporting on file access > >> > >> By making the error reporting include strerror(errno), it gives the user > >> a bit more indication as to why qemu failed. This is particularly > >> important for people running qemu as a non root user. > >> > >> Signed-off-by: Justin M. Forbes > > > > Certainly looks sensible to me > > > > Not having this is hurting us in Fedora 12 because we've started running > > qemu as an unprivileged user and people are having a hard time figuring > > out the various errors they're seeing caused by the change. This should > > help them. > > > > Only concern is that errno might not be getting propagated correctly by > > some of these functions, but we can fix that later if so. > > Here's one: > > diff --git a/vl.c b/vl.c > index 7bfd415..70fd2ca 100644 > --- a/vl.c > +++ b/vl.c > @@ -2232,8 +2232,8 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque, > } > > if (bdrv_open2(dinfo->bdrv, file, bdrv_flags, drv) < 0) { > - fprintf(stderr, "qemu: could not open disk image %s\n", > - file); > + fprintf(stderr, "qemu: could not open disk image %s: %s\n", > + file, strerror(errno)); > return NULL; > } > bdrv_open2 is not guaranteed to use POSIX functions for it's file manipulation, hence the patch is wrong. -- mailto:av1474@comtv.ru