Received: from eggs.gnu.org ([2001:4830:134:3::10]:37638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0u24-0002Un-SJ for qemu-devel@nongnu.org; Thu, 12 May 2016 13:04:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0u1z-0000zF-HK for qemu-devel@nongnu.org; Thu, 12 May 2016 13:04:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0u1z-0000zA-BM for qemu-devel@nongnu.org; Thu, 12 May 2016 13:04:11 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 115B396D3 for ; Thu, 12 May 2016 17:04:10 +0000 (UTC) Date: Thu, 12 May 2016 14:04:08 -0300 From: Eduardo Habkost Message-ID: <20160512170408.GN4457@thinpad.lan.raisama.net> References: <1463062204-20330-1-git-send-email-ehabkost@redhat.com> <1487093908.13650793.1463071721586.JavaMail.zimbra@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1487093908.13650793.1463071721586.JavaMail.zimbra@redhat.com> Subject: Re: [Qemu-devel] [PATCH 0/6] Use &error_fatal in some initialization code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Markus Armbruster On Thu, May 12, 2016 at 12:48:41PM -0400, Paolo Bonzini wrote: > > > This changes some initialization code in vl.c, qemu-img, qemu-io, > > and qemu-nbd to use &error_fatal instead of manual error > > checking/reporting. > > > > The series is based on my machine branch, available at: > > git://github.com/ehabkost/qemu.git machine > > Patches 1-2-6 are obvious. Thanks. I will apply 1-2 to my machine branch. Should I apply patch 6, too? > > I'm not sure about 3-4-5, these are internal functions where the error > is somewhere below "should never happen" (&error_abort)---it actually > should never happen, but exiting due to SIGABRT sounds wrong. It's not > the kind of function that I'd expect to have an Error** argument... Assuming you still want to keep the Error** argument in qemu_init_main_loop(), I can send a simpler patch that doesn't touch qemu_signal_init(). In that case, qemu_init_main_loop() at least needs to be consistent, and always set *errp if returning non-zero (it doesn't, and QEMU will crash inside error_report_err() if qemu_signal_init() fail). Or, if you prefer, we can remove the Error** argument from qemu_init_main_loop() completely, and make it report errors to stderr. > > Paolo > > > Eduardo Habkost (6): > > vl: Use &error_fatal when parsing VNC options > > vl: Use &error_fatal when parsing monitor options > > main-loop: Use Error** to report qemu_signal_init() errors > > main-loop: Use &error_fatal when calling qemu_init_main_loop() > > main-loop: Make qemu_init_main_loop() and qemu_signal_init() void > > Use &error_fatal when initializing crypto on qemu-{img,io,nbd} > > > > include/qemu/main-loop.h | 2 +- > > main-loop.c | 24 ++++++++++-------------- > > qemu-img.c | 11 ++--------- > > qemu-io.c | 11 ++--------- > > qemu-nbd.c | 10 ++-------- > > vl.c | 28 ++++------------------------ > > 6 files changed, 21 insertions(+), 65 deletions(-) > > > > -- > > 2.5.5 > > > > -- Eduardo