From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTtGZ-0005sW-Uf for qemu-devel@nongnu.org; Tue, 16 Sep 2014 09:58:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTtGR-00078G-Bf for qemu-devel@nongnu.org; Tue, 16 Sep 2014 09:57:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTtGR-00077k-4o for qemu-devel@nongnu.org; Tue, 16 Sep 2014 09:57:51 -0400 Message-ID: <541841C5.8060100@redhat.com> Date: Tue, 16 Sep 2014 15:57:25 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1410858395-24589-1-git-send-email-cnanakos@grnet.gr> <1410858395-24589-2-git-send-email-cnanakos@grnet.gr> <20140916135316.GA19869@irqsave.net> In-Reply-To: <20140916135316.GA19869@irqsave.net> Content-Type: text/plain; charset=windows-1252 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: =?windows-1252?Q?Beno=EEt_Canet?= , Chrysostomos Nanakos 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 Il 16/09/2014 15:53, Beno=EEt 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(l= ocal_error)); >=20 >=20 >> > + exit(1); > Also here I don't know if exiting in the middle of a class initializati= on > completion function is good taste. > You should ask to someone knowing QOM. >=20 Indeed, the right thing to do is simply error_propagate(errp, local_error); return; Paolo