From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTykS-0003Xc-0v for qemu-devel@nongnu.org; Tue, 16 Sep 2014 15:49:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTykL-00059y-TX for qemu-devel@nongnu.org; Tue, 16 Sep 2014 15:49:11 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:48628 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTykL-000518-N8 for qemu-devel@nongnu.org; Tue, 16 Sep 2014 15:49:05 -0400 Date: Tue, 16 Sep 2014 21:48:00 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140916194800.GA8370@irqsave.net> References: <1410890642-6704-1-git-send-email-cnanakos@grnet.gr> <1410890642-6704-2-git-send-email-cnanakos@grnet.gr> <54189228.6090907@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <54189228.6090907@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3] async: aio_context_new(): Handle event_notifier_init failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Chrysostomos Nanakos , 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 The Tuesday 16 Sep 2014 =E0 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: > >=20 > > # qemu [...] >=20 > Showing the actual command line you used would be helpful. >=20 > > qemu: Failed to initialize event notifier: Too many open files in sy= stem > >=20 > > Signed-off-by: Chrysostomos Nanakos > > --- > > 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(-) > >=20 >=20 > > -AioContext *aio_context_new(void) > > +AioContext *aio_context_new(Error **errp) > > { > > + int ret; > > AioContext *ctx; > > ctx =3D (AioContext *) g_source_new(&aio_source_funcs, sizeof(Ai= oContext)); > > + ret =3D event_notifier_init(&ctx->notifier, false); > > + if (ret < 0) { > > + g_source_destroy(&ctx->source); >=20 > Does g_source_destroy() guarantee that errno is unmolested? If not, >=20 > > + error_setg_errno(errp, -ret, "Failed to initialize event not= ifier"); Actually -ret is passed to error_setg_errno. See. void error_set_errno(Error **errp, int os_errno, ErrorClass err_class, = =20 const char *fmt, ...)=20 and if (os_errno !=3D 0) { = =20 err->msg =3D g_strdup_printf("%s: %s", msg1, strerror(os_errn= o)); =20 > Use of \' inside "" is unusual. (Multiple times in your patch) My fault.