public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Pekka Enberg <penberg@kernel.org>,
	Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: kvm@vger.kernel.org, Asias He <asias.hejun@gmail.com>,
	Sasha Levin <levinsasha928@gmail.com>
Subject: Re: [PATCH] kvm tools: Plug warning in virtio_p9_wstat()
Date: Sun, 10 Jul 2011 22:53:39 +0530	[thread overview]
Message-ID: <87vcvaoxr8.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAOJsxLEuWrurw5D5STHC5tCuKr+V0qWj=55VHRVpdB3udYLSpw@mail.gmail.com>

On Sun, 10 Jul 2011 15:18:41 +0300, Pekka Enberg <penberg@kernel.org> wrote:
> On Sun, Jul 10, 2011 at 3:01 PM, Konstantin Khlebnikov
> <khlebnikov@openvz.org> wrote:
> > glibc declare ftruncate() with attribute warn_unused_result, so result must be "checked", otherwise we get:
> >
> > virtio/9p.c:487:6: error: variable ‘res’ set but not used [-Werror=unused-but-set-variable]
> > or
> > virtio/9p.c:496:12: error: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Werror=unused-result]
> >
> > Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
> > ---
> >  tools/kvm/virtio/9p.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/tools/kvm/virtio/9p.c b/tools/kvm/virtio/9p.c
> > index d927688..4586f66 100644
> > --- a/tools/kvm/virtio/9p.c
> > +++ b/tools/kvm/virtio/9p.c
> > @@ -495,6 +495,7 @@ static void virtio_p9_wstat(struct p9_dev *p9dev,
> >
> >        if (wstat.length != -1UL)
> >                res = ftruncate(fid->fd, wstat.length);
> > +       (void)res; /* To plug the warning. FIXME what if ftruncate fails? */
> 
> There's a
> 
>   make WERROR=0
> 
> to work around the warning. Sasha, Aneesh, shouldn't we propagate an
> error to the guest here?
> 

Yes we should. We should do an RERROR message to the guest.
I guess other functions in 9p.c is also missing error handling.

-aneesh

      reply	other threads:[~2011-07-10 17:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-10 12:01 [PATCH] kvm tools: Plug warning in virtio_p9_wstat() Konstantin Khlebnikov
2011-07-10 12:18 ` Pekka Enberg
2011-07-10 17:23   ` Aneesh Kumar K.V [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=87vcvaoxr8.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=asias.hejun@gmail.com \
    --cc=khlebnikov@openvz.org \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=penberg@kernel.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