From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQvHc-0004IL-JJ for qemu-devel@nongnu.org; Thu, 07 Jun 2018 09:48:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQvHb-00027W-Or for qemu-devel@nongnu.org; Thu, 07 Jun 2018 09:48:56 -0400 From: Markus Armbruster References: <20180529174821.19964-1-f4bug@amsat.org> Date: Thu, 07 Jun 2018 15:48:47 +0200 In-Reply-To: <20180529174821.19964-1-f4bug@amsat.org> ("Philippe =?utf-8?Q?Mathieu-Daud=C3=A9=22's?= message of "Tue, 29 May 2018 14:48:17 -0300") Message-ID: <87lgbqvha8.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 0/4] qapi/error: converts error_setg(&error_fatal) to error_report() + exit() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Cc: Eric Blake , Kevin Wolf , Peter Maydell , qemu-block@nongnu.org, Peter Crosthwaite , qemu-devel@nongnu.org, Alexander Graf , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Max Reitz , John Snow , David Gibson Philippe Mathieu-Daud=C3=A9 writes: > Hi, > > This series converts error_setg(&error_fatal) to error_report() + exit() = as > suggested by the "qapi/error.h" documentation. Appreciated! The series actually converts two anti-patterns. 1. From if (COND) { error_setg(&error_fatal, ...); } to if (COND) { error_report(...); exit(1); } This is exactly what error.h asks for. 2. From if (COND) { error_setg(&error_abort, ...); } to if (COND) { error_report(...); abort(); } error.h asks for assert(!COND); instead. See my reply to PATCH 1 for why.