From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Andreas Färber" <afaerber@suse.de>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Anthony Liguori" <aliguori@amazon.com>,
"Igor Mammedov" <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] pc.c: better error message on initrd sizing failure
Date: Wed, 5 Feb 2014 21:59:14 +0200 [thread overview]
Message-ID: <20140205195914.GA8017@redhat.com> (raw)
In-Reply-To: <CAFEAcA_8zjxKK-m8L6Nyrei8aG96N=CSuA-8Jn33VVsL0JLNQQ@mail.gmail.com>
On Sun, Feb 02, 2014 at 08:46:35PM +0000, Peter Maydell wrote:
> On 2 February 2014 20:46, Michael S. Tsirkin <mst@redhat.com> wrote:
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > hw/i386/pc.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> > index 348b15f..e715a33 100644
> > --- a/hw/i386/pc.c
> > +++ b/hw/i386/pc.c
> > @@ -835,8 +835,8 @@ static void load_linux(FWCfgState *fw_cfg,
> >
> > initrd_size = get_image_size(initrd_filename);
> > if (initrd_size < 0) {
> > - fprintf(stderr, "qemu: error reading initrd %s\n",
> > - initrd_filename);
> > + fprintf(stderr, "qemu: error reading initrd %s: %s\n",
> > + initrd_filename, strerror(errno));
> > exit(1);
>
> get_image_size() happens to set errno on failure, but it
> doesn't guarantee to -- all the doc comment says currently
> is "return the size or -1 if error". If we're going to rely on
> errno being set in the failure case it would be nice to at
> least add an "(and errno is set)" to that. (Better still would
> be to transfer the info into a properly formatted doc comment
> for the prototype in include/hw/loader.h...)
>
> thanks
> -- PMM
Good idea. This patch doesn't have to change though - I'll post
an additional one with the comment.
prev parent reply other threads:[~2014-02-05 19:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-02 20:46 [Qemu-devel] [PATCH] pc.c: better error message on initrd sizing failure Michael S. Tsirkin
2014-02-02 20:46 ` Peter Maydell
2014-02-05 19:59 ` Michael S. Tsirkin [this message]
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=20140205195914.GA8017@redhat.com \
--to=mst@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@amazon.com \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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).