From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTuv1-0005mk-DC for qemu-devel@nongnu.org; Tue, 16 Sep 2014 11:43:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTuut-0003z4-TJ for qemu-devel@nongnu.org; Tue, 16 Sep 2014 11:43:51 -0400 Received: from averel.grnet-hq.admin.grnet.gr ([195.251.29.3]:27157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTuut-0003xd-MZ for qemu-devel@nongnu.org; Tue, 16 Sep 2014 11:43:43 -0400 Date: Tue, 16 Sep 2014 18:43:30 +0300 From: Chrysostomos Nanakos Message-ID: <20140916154330.GA4631@blackdevil> References: <1410858395-24589-1-git-send-email-cnanakos@grnet.gr> <1410858395-24589-2-git-send-email-cnanakos@grnet.gr> <20140916135316.GA19869@irqsave.net> <541841C5.8060100@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <541841C5.8060100@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] async: aio_context_new(): Handle event_notifier_init failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: =?utf-8?Q?Beno=C3=AEt?= Canet , Chrysostomos Nanakos , 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, kwolf@redhat.com, afaerber@suse.de, aliguori@amazon.com On Tue, Sep 16, 2014 at 03:57:25PM +0200, Paolo Bonzini wrote: > Il 16/09/2014 15:53, Beno=C3=AEt Canet ha scritto: > >> static void iothread_complete(UserCreatable *obj, Error **errp) > >> > { > >> > + Error *local_error =3D NULL; > >> > IOThread *iothread =3D IOTHREAD(obj); > >> > =20 > >> > iothread->stopping =3D false; > >> > - iothread->ctx =3D aio_context_new(); > >> > + iothread->ctx =3D 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. > >=20 > > You could do something in the vein of. > > error_report("Failed to create AIO Context: \'%s\'", error_get_pretty= (local_error)); > >=20 > >=20 > >> > + exit(1); > > Also here I don't know if exiting in the middle of a class initializa= tion > > completion function is good taste. > > You should ask to someone knowing QOM. > >=20 >=20 > Indeed, the right thing to do is simply >=20 > error_propagate(errp, local_error); > return; Just to note that after propagating the error and returning, QEMU fails silently without printing the error message. I will make the proposed changes and try to resolve this in the next patc= h series if this is possible. Regards, Chrysostomos.