From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xg8Ts-00018C-7B for qemu-devel@nongnu.org; Mon, 20 Oct 2014 04:38:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xg8Tm-0006I7-2b for qemu-devel@nongnu.org; Mon, 20 Oct 2014 04:38:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xg8Tl-0006Hy-RS for qemu-devel@nongnu.org; Mon, 20 Oct 2014 04:38:13 -0400 From: Markus Armbruster References: <1413371003-43597-1-git-send-email-imammedo@redhat.com> <1413371003-43597-3-git-send-email-imammedo@redhat.com> Date: Mon, 20 Oct 2014 10:38:07 +0200 In-Reply-To: <1413371003-43597-3-git-send-email-imammedo@redhat.com> (Igor Mammedov's message of "Wed, 15 Oct 2014 13:03:23 +0200") Message-ID: <87oat76sr4.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 2/2] vl.c: reduce exit on error code duplication List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, aliguori@amazon.com Igor Mammedov writes: > use exit_if_error() helper instead of a bunch of > if (local_err) { > error_report(foo); > error_free(local_err); > exit(1); > } > code blocks > > Signed-off-by: Igor Mammedov A quick "git-grep -B 2 -w exit" shows the pattern exists outside vl.c. The instances in hw/ are of course suspect. Anyway, the helper seems more generally useful. Let's put it in util/ now, rather than move it later. Suggest to name it something like error_report_fatal(), to make both the fact that it reports and that it exits obvious from the name.