From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4ZrA-0001Pj-O5 for qemu-devel@nongnu.org; Wed, 31 Jul 2013 13:06:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V4Zr2-00042g-QH for qemu-devel@nongnu.org; Wed, 31 Jul 2013 13:06:36 -0400 Received: from mout.web.de ([212.227.17.11]:57219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4Zr2-000415-GQ for qemu-devel@nongnu.org; Wed, 31 Jul 2013 13:06:28 -0400 Received: from envy.site ([195.135.221.2]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0LiCrz-1UIeFm2Jxj-00nO6O for ; Wed, 31 Jul 2013 19:06:26 +0200 Message-ID: <51F94410.20905@web.de> Date: Wed, 31 Jul 2013 19:06:24 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1374614206-9368-1-git-send-email-hpoussin@reactos.org> <1374614206-9368-3-git-send-email-hpoussin@reactos.org> <51F6E46A.6080708@web.de> <51F81CC6.8090104@reactos.org> In-Reply-To: <51F81CC6.8090104@reactos.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 2/2] i82378: cleanup implementation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= Cc: Peter Crosthwaite , "Michael S. Tsirkin" , Hu Tao , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Anthony Liguori , Paolo Bonzini Am 30.07.2013 22:06, schrieb Hervé Poussineau: > Andreas Färber a écrit : >> Am 23.07.2013 23:16, schrieb Hervé Poussineau: >>> } >>> >>> -static void i82378_init(DeviceState *dev, I82378State *s) >>> +static void i82378_realize(DeviceState *dev, Error **errp) >>> { >>> - ISABus *isabus = ISA_BUS(qdev_get_child_bus(dev, "isa.0")); >>> - ISADevice *pit; >>> + PCIDevice *pci = PCI_DEVICE(dev); >>> + I82378State *s = I82378(dev); >>> + DeviceClass *dc; >>> + uint8_t *pci_conf; >>> + ISABus *isabus; >>> ISADevice *isa; >>> qemu_irq *out0_irq; >>> >>> + dc = >>> DEVICE_CLASS(object_class_get_parent(object_get_class(OBJECT(dev)))); >> >> This is going into uncharted territories. ;) I consider it wrong to use >> object_get_class() - we should use object_class_by_name() to allow for >> derived types and I'll put it into a macro that I'll try to align with >> Peter C.'s and my QOM work. > > OK While this gave me an inspiration for my virtio refactoring (it is possible to convert device by device by calling the parent's DeviceClass::realize as done here, as long as the *Class::init is called conditionally through the DeviceClass::init implementation), I am concerned about a single device deviating from initialization order here (hw/pci/pci.c:pci_qdev_init() does things after calling PCIDevice::init, namely ROM handling and bus hotplug) and will revert this to an old-style qdev initfn for 1.6 bugfix. [...] >>> + dc->no_user = 1; >> >> Why do you do this? For one, according to Anthony it should no longer be >> used, and for another, Paolo's endianness-test (make check) is using >> -device i82378 for various other ppc and sh4 machines IIUC. make check >> still succeeds for ppc with this patch though, so that might be due to >> -device ignoring DeviceClass::no_user? > > I probably copied it from another chipset device, maybe i440fx. > I don't really mind removing it. Good. > Yes, I double-checked that make check still works for all architectures. > >> Hoping to get this in shape for -rc1. > > Sure. Should I send a v2, as it seems you already queued it? Since -rc1 is due tomorrow, I'll put together a pull myself tonight. Andreas