Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NWvdT-0004YP-1g for qemu-devel@nongnu.org; Mon, 18 Jan 2010 12:43:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NWvdO-0004Xv-BR for qemu-devel@nongnu.org; Mon, 18 Jan 2010 12:43:30 -0500 Received: from [199.232.76.173] (port=35767 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWvdO-0004Xq-2V for qemu-devel@nongnu.org; Mon, 18 Jan 2010 12:43:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:62595) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NWvdN-0004ED-Ik for qemu-devel@nongnu.org; Mon, 18 Jan 2010 12:43:25 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH] Improve error reporting on file access References: <20091001144256.GA30845@linuxtx.org> <1254413572.2920.37.camel@blaa> <60F63A1A-607C-4168-8CCB-873FDA453658@web.de> Date: Mon, 18 Jan 2010 18:43:21 +0100 In-Reply-To: <60F63A1A-607C-4168-8CCB-873FDA453658@web.de> ("Andreas =?utf-8?Q?F=C3=A4rber=22's?= message of "Sun, 29 Nov 2009 13:20:02 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= Cc: Mark McLoughlin , "Justin M. Forbes" , QEMU Developers Andreas F=C3=A4rber writes: > Hello, > > Am 27.10.2009 um 18:38 schrieb malc: > >> 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 > >>>> 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. > > It appears, the patch was applied in > 850810d01b45e6ce99ac6696773e967890db2937 (Oct 5). > > On OpenSolaris 2009.06 amd64 I now get: > > qemu: could not open disk image /[...].iso: Not owner > > I am owner though. If I run it with pfexec (priviledged), I get: > > qemu: could not open disk image /[...].iso: No such file or directory > > The file is there and my script used to work before Juan's Makefile > reorganization with the --whole-archive workaround I posted. > > So my guess is, we do see a stray errno here? > > Andreas As malc said, the patch is wrong. It should be reverted until somebody comes up with a fix.