All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benoît Canet" <benoit.canet@irqsave.net>
To: Eric Blake <eblake@redhat.com>
Cc: Chrysostomos Nanakos <cnanakos@grnet.gr>,
	kwolf@redhat.com, pingfank@linux.vnet.ibm.com, famz@redhat.com,
	kroosec@gmail.com, jan.kiszka@siemens.com, mjt@tls.msk.ru,
	qemu-devel@nongnu.org, stefanha@redhat.com, sw@weilnetz.de,
	pbonzini@redhat.com, afaerber@suse.de, aliguori@amazon.com
Subject: Re: [Qemu-devel] [PATCH v3] async: aio_context_new(): Handle event_notifier_init failure
Date: Tue, 16 Sep 2014 21:48:00 +0200	[thread overview]
Message-ID: <20140916194800.GA8370@irqsave.net> (raw)
In-Reply-To: <54189228.6090907@redhat.com>

The Tuesday 16 Sep 2014 à 13:40:24 (-0600), Eric Blake wrote :
> On 09/16/2014 12:04 PM, Chrysostomos Nanakos wrote:
> > If event_notifier_init fails QEMU exits without printing
> > any error information to the user. This commit adds an error
> > message on failure:
> > 
> >  # qemu [...]
> 
> Showing the actual command line you used would be helpful.
> 
> >  qemu: Failed to initialize event notifier: Too many open files in system
> > 
> > Signed-off-by: Chrysostomos Nanakos <cnanakos@grnet.gr>
> > ---
> >  async.c                  |   16 +++++++++++-----
> >  include/block/aio.h      |    2 +-
> >  include/qemu/main-loop.h |    2 +-
> >  iothread.c               |   11 ++++++++++-
> >  main-loop.c              |    9 +++++++--
> >  qemu-img.c               |    8 +++++++-
> >  qemu-io.c                |    7 ++++++-
> >  qemu-nbd.c               |    6 +++++-
> >  tests/test-aio.c         |   10 +++++++++-
> >  tests/test-thread-pool.c |   10 +++++++++-
> >  tests/test-throttle.c    |   10 +++++++++-
> >  vl.c                     |    5 +++--
> >  12 files changed, 78 insertions(+), 18 deletions(-)
> > 
> 
> > -AioContext *aio_context_new(void)
> > +AioContext *aio_context_new(Error **errp)
> >  {
> > +    int ret;
> >      AioContext *ctx;
> >      ctx = (AioContext *) g_source_new(&aio_source_funcs, sizeof(AioContext));
> > +    ret = event_notifier_init(&ctx->notifier, false);
> > +    if (ret < 0) {
> > +        g_source_destroy(&ctx->source);
> 
> Does g_source_destroy() guarantee that errno is unmolested? If not,
> 
> > +        error_setg_errno(errp, -ret, "Failed to initialize event notifier");

Actually -ret is passed to error_setg_errno.

See.

void error_set_errno(Error **errp, int os_errno, ErrorClass err_class,          
                     const char *fmt, ...) 
and
    if (os_errno != 0) {                                                        
            err->msg = g_strdup_printf("%s: %s", msg1, strerror(os_errno));  

> Use of \' inside "" is unusual. (Multiple times in your patch)

My fault.

  reply	other threads:[~2014-09-16 19:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 18:04 [Qemu-devel] [PATCH v3] async: aio_context_new(): Handle event_notifier_init failure Chrysostomos Nanakos
2014-09-16 18:04 ` Chrysostomos Nanakos
2014-09-16 19:40   ` Eric Blake
2014-09-16 19:48     ` Benoît Canet [this message]
2014-09-17  9:16     ` Chrysostomos Nanakos
2014-09-17 13:01       ` Eric Blake
2014-09-17 13:18         ` Chrysostomos Nanakos

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=20140916194800.GA8370@irqsave.net \
    --to=benoit.canet@irqsave.net \
    --cc=afaerber@suse.de \
    --cc=aliguori@amazon.com \
    --cc=cnanakos@grnet.gr \
    --cc=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kroosec@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=pingfank@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=sw@weilnetz.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.