qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: malc <av1474@comtv.ru>
To: Markus Armbruster <armbru@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>,
	"Justin M. Forbes" <jmforbes@linuxtx.org>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Improve error reporting on file access
Date: Tue, 27 Oct 2009 20:38:10 +0300 (MSK)	[thread overview]
Message-ID: <Pine.LNX.4.64.0910272037090.2215@linmac.oyster.ru> (raw)
In-Reply-To: <m3k4ygg4ps.fsf@crossbow.pond.sub.org>

On Tue, 27 Oct 2009, Markus Armbruster wrote:

> Mark McLoughlin <markmc@redhat.com> writes:
> 
> > On Thu, 2009-10-01 at 09:42 -0500, Justin M. Forbes wrote:
> >> Author: Justin M. Forbes <jforbes@redhat.com>
> >> 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 <jforbes@redhat.com>
> >
> > 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

  reply	other threads:[~2009-10-27 17:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-01 14:42 [Qemu-devel] [PATCH] Improve error reporting on file access Justin M. Forbes
2009-10-01 16:12 ` Mark McLoughlin
2009-10-27 16:51   ` Markus Armbruster
2009-10-27 17:38     ` malc [this message]
2009-11-29 12:20       ` Andreas Färber
2010-01-18 17:43         ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0910272037090.2215@linmac.oyster.ru \
    --to=av1474@comtv.ru \
    --cc=armbru@redhat.com \
    --cc=jmforbes@linuxtx.org \
    --cc=markmc@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).