From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a797X-0001Fh-Rx for qemu-devel@nongnu.org; Thu, 10 Dec 2015 16:51:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a797U-0003LJ-Mm for qemu-devel@nongnu.org; Thu, 10 Dec 2015 16:51:27 -0500 Received: from smtp2-g21.free.fr ([212.27.42.2]:1359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a797U-0003Jk-HS for qemu-devel@nongnu.org; Thu, 10 Dec 2015 16:51:24 -0500 Message-ID: <5669F3D0.2040700@reactos.org> Date: Thu, 10 Dec 2015 22:51:12 +0100 From: =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= MIME-Version: 1.0 References: <1449743372-17169-1-git-send-email-armbru@redhat.com> <1449743372-17169-10-git-send-email-armbru@redhat.com> In-Reply-To: <1449743372-17169-10-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 09/12] isa: Clean up error handling around isa_bus_new() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Mark Cave-Ayland , Aurelien Jarno , Richard Henderson Le 10/12/2015 11:29, Markus Armbruster a =C3=A9crit : > We can have at most one ISA bus. If you try to create another one, > isa_bus_new() complains to stderr and returns null. > > isa_bus_new() is called in two contexts, machine's init() and device's > realize() methods. Since complaining to stderr is not proper in the > latter context, convert isa_bus_new() to Error. > > Machine's init(): > > * mips_jazz_init(), called from the init() methods of machines > "magnum" and "pica" > > * mips_r4k_init(), the init() method of machine "mips" > > * pc_init1() called from the init() methods of non-q35 PC machines > > * typhoon_init(), called from clipper_init(), the init() method of > machine "clipper" > > These callers always create the first ISA bus, hence isa_bus_new() > can't fail. Simply pass &error_abort. > > Device's realize(): > > * i82378_realize(), of PCI device "i82378" > > * ich9_lpc_realize(), of PCI device "ICH9-LPC" > > * pci_ebus_realize(), of PCI device "ebus" > > * piix3_realize(), of PCI device "pci-piix3", abstract parent of > "PIIX3" and "PIIX3-xen" > > * piix4_realize(), of PCI device "PIIX4" > > * vt82c686b_realize(), of PCI device "VT82C686B" > > Propagate the error. Note that these devices are typically created > only by machine init() methods with qdev_init_nofail() or similar. If > we screwed up and created an ISA bus before that call, we now give up > right away. Before, we'd hobble on, and typically die in > isa_bus_irqs(). Similar if someone finds a way to hot-plug one of > these critters. > > 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