From: Paolo Bonzini <pbonzini@redhat.com>
To: "Benoît Canet" <benoit.canet@irqsave.net>,
"Chrysostomos Nanakos" <cnanakos@grnet.gr>
Cc: 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,
afaerber@suse.de, aliguori@amazon.com
Subject: Re: [Qemu-devel] [PATCH v2] async: aio_context_new(): Handle event_notifier_init failure
Date: Tue, 16 Sep 2014 15:57:25 +0200 [thread overview]
Message-ID: <541841C5.8060100@redhat.com> (raw)
In-Reply-To: <20140916135316.GA19869@irqsave.net>
Il 16/09/2014 15:53, Benoît Canet ha scritto:
>> static void iothread_complete(UserCreatable *obj, Error **errp)
>> > {
>> > + Error *local_error = NULL;
>> > IOThread *iothread = IOTHREAD(obj);
>> >
>> > iothread->stopping = false;
>> > - iothread->ctx = aio_context_new();
>> > + iothread->ctx = aio_context_new(&local_error);
>> > + if (!iothread->ctx) {
>> > + error_report("%s", error_get_pretty(local_error));
>> > + error_report("Failed to create AIO context");
> I think reporting one line is sufficient.
>
> You could do something in the vein of.
> error_report("Failed to create AIO Context: \'%s\'", error_get_pretty(local_error));
>
>
>> > + exit(1);
> Also here I don't know if exiting in the middle of a class initialization
> completion function is good taste.
> You should ask to someone knowing QOM.
>
Indeed, the right thing to do is simply
error_propagate(errp, local_error);
return;
Paolo
next prev parent reply other threads:[~2014-09-16 13:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-16 9:06 [Qemu-devel] [PATCH v2] async: aio_context_new(): Handle event_notifier_init failure Chrysostomos Nanakos
2014-09-16 9:06 ` Chrysostomos Nanakos
2014-09-16 13:53 ` Benoît Canet
2014-09-16 13:57 ` Paolo Bonzini [this message]
2014-09-16 15:43 ` Chrysostomos Nanakos
2014-09-16 15:45 ` Paolo Bonzini
2014-09-16 15:50 ` Chrysostomos Nanakos
2014-09-16 17:58 ` 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=541841C5.8060100@redhat.com \
--to=pbonzini@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@amazon.com \
--cc=benoit.canet@irqsave.net \
--cc=cnanakos@grnet.gr \
--cc=famz@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kroosec@gmail.com \
--cc=kwolf@redhat.com \
--cc=mjt@tls.msk.ru \
--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 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).