Received: from eggs.gnu.org ([2001:4830:134:3::10]:47690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9ZWw-00078L-SQ for qemu-devel@nongnu.org; Thu, 17 Dec 2015 09:27:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9ZWt-0003zI-4W for qemu-devel@nongnu.org; Thu, 17 Dec 2015 09:27:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9ZWs-0003zC-VA for qemu-devel@nongnu.org; Thu, 17 Dec 2015 09:27:39 -0500 From: Markus Armbruster References: <1450354795-31608-1-git-send-email-armbru@redhat.com> <1450354795-31608-12-git-send-email-armbru@redhat.com> <20151217153756-mutt-send-email-mst@redhat.com> Date: Thu, 17 Dec 2015 15:27:36 +0100 In-Reply-To: <20151217153756-mutt-send-email-mst@redhat.com> (Michael S. Tsirkin's message of "Thu, 17 Dec 2015 15:39:28 +0200") Message-ID: <877fkdjgkn.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 11/13] isa: Clean up inappropriate hw_error() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: =?utf-8?Q?Herv=C3=A9?= Poussineau , Mark Cave-Ayland , qemu-devel@nongnu.org, Aurelien Jarno , Richard Henderson "Michael S. Tsirkin" writes: > On Thu, Dec 17, 2015 at 01:19:53PM +0100, Markus Armbruster wrote: >> isa_bus_irqs(), isa_create() and isa_try_create() call hw_error() when >> passed a null bus. Use of hw_error() has always been questionable, >> because these are used only during machine initialization, and >> printing CPU registers isn't useful there. >>=20 >> Since the previous commit, passing a null bus is a programming error. >> Drop the hw_error() and simply let it crash. >>=20 >> Cc: Richard Henderson >> Cc: "Michael S. Tsirkin" >> Cc: "Herv=C3=A9 Poussineau" >> Cc: Aurelien Jarno >> Cc: Mark Cave-Ayland >> Signed-off-by: Markus Armbruster >> Reviewed-by: Herv=C3=A9 Poussineau > > I'd prefer an assert just in case. I understand "prefer", I don't understand "just in case" :) Adding an assertion here merely converts one kind of crash into another. Doesn't make anything safer, not even just in case something happens we thought was impossible. Does print a message before crashing that some developers may find useful. Might make our belief that null can't happen a bit more explicit. My own preference is not to assert the blatantly obvious. However, I'm certainly willing to defer to a maintainer's or reviewer's preference, within reason. For what it's worth: $ scripts/get_maintainer.pl -f hw/isa/isa-bus.c=20 get_maintainer.pl: No maintainers found, printing recent contributors. get_maintainer.pl: Do not blindly cc: them on patches! Use common sens= e. "Herv=C3=A9 Poussineau" (commit_signer:4/6=3D67%) Markus Armbruster (commit_signer:3/6=3D50%) Leon Alrae (commit_signer:2/6=3D33%) Paolo Bonzini (commit_signer:2/6=3D33%) Dave Airlie (commit_signer:1/6=3D17%) Considering all of the above, do you want me to add the assertions?