From: "Daniel P. Berrange" <berrange@redhat.com>
To: Felipe Franciosi <felipe@nutanix.com>
Cc: Eric Blake <eblake@redhat.com>,
"famz@redhat.com" <famz@redhat.com>,
"mst@redhat.com" <mst@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"stefanha@redhat.com" <stefanha@redhat.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"marcandre.lureau@redhat.com" <marcandre.lureau@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4 0/3] Introduce vhost-user-scsi and sample application
Date: Thu, 2 Mar 2017 17:32:14 +0000 [thread overview]
Message-ID: <20170302173214.GH11445@redhat.com> (raw)
In-Reply-To: <3FB730F1-6067-4FD4-8D3F-19C648472B1B@nutanix.com>
On Thu, Mar 02, 2017 at 05:21:46PM +0000, Felipe Franciosi wrote:
>
> > On 2 Mar 2017, at 17:17, Daniel P. Berrange <berrange@redhat.com> wrote:
> >
> > On Thu, Mar 02, 2017 at 05:01:06PM +0000, Felipe Franciosi wrote:
> >> Hi Eric,
> >>
> >> Ping on this?
> >> http://lists.nongnu.org/archive/html/qemu-devel/2016-10/msg06169.html
> >
> > [snip]
> >
> >> CC contrib/ivshmem-client/main.o
> >> /var/tmp/patchew-tester-tmp-naxuy_ku/src/contrib/libvhost-user/libvhost-user.c: In function ‘vu_panic’:
> >> /var/tmp/patchew-tester-tmp-naxuy_ku/src/contrib/libvhost-user/libvhost-user.c:84:5: error: ignoring return value of ‘vasprintf’, declared with attribute warn_unused_result [-Werror=unused-result]
> >> (void)vasprintf(&buf, msg, ap);
> >> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >> cc1: all warnings being treated as errors
> >
> > You can side-step the issue entirely by simply not using the vasprintf
> > function. Instead do 'buf = g_strdup_vprintf(msg, ap);' - glib does
> > abort-on-oom, so there's no error scenario you need to handle.
>
> Thanks for the pointer. That code is in libvhost-user already. I can send a separate patch to fix that if you prefer.
Yeah, it wasn't previously noticed since these files weren't compiled
by default. Since you've added make rules to enable build, I'm afraid
you've got the unfortunate job of cleaning up pre-existing build
problems. I'd suggest just doing the conversion to g_strdup_vprintf()
in the first patch your series.
> Just think that for this kind of usage a simple ignore_value(vasprintf(...)) is sufficient; that call is in a panic path already.
I think it is more correct to switch to g_strdup_vprintf so we get an immediate
abort, than to use ignore_value here.
> There were other cases where ignoring the return value seemed like the
> preferred thing to do.
Thre's a few scenarios where ignoring an OOM error is appropriate, but as a
general rule QEMU aims to abort on OOM rather than ignore it or try to handle
it.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
next prev parent reply other threads:[~2017-03-02 17:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-02 16:43 [Qemu-devel] [PATCH v4 0/3] Introduce vhost-user-scsi and sample application Felipe Franciosi
2017-03-02 16:43 ` [Qemu-devel] [PATCH v4 1/3] vhost-scsi: create a vhost-scsi-common abstraction Felipe Franciosi
2017-03-02 16:43 ` [Qemu-devel] [PATCH v4 2/3] vus: Introduce vhost-user-scsi host device Felipe Franciosi
2017-03-02 16:43 ` [Qemu-devel] [PATCH v4 3/3] vus: Introduce a vhost-user-scsi sample application Felipe Franciosi
2017-03-02 16:48 ` [Qemu-devel] [PATCH v4 0/3] Introduce vhost-user-scsi and " no-reply
2017-03-02 16:50 ` no-reply
2017-03-02 16:55 ` no-reply
2017-03-02 17:01 ` Felipe Franciosi
2017-03-02 17:17 ` Daniel P. Berrange
2017-03-02 17:21 ` Felipe Franciosi
2017-03-02 17:32 ` Daniel P. Berrange [this message]
2017-03-02 17:39 ` Felipe Franciosi
2017-03-02 18:08 ` Paolo Bonzini
2017-03-02 18:12 ` Felipe Franciosi
2017-03-02 19:26 ` Eric Blake
2017-03-29 12:40 ` Michael S. Tsirkin
2017-03-29 22:14 ` Felipe Franciosi
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=20170302173214.GH11445@redhat.com \
--to=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=felipe@nutanix.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).