From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0uV6-0001bB-CS for qemu-devel@nongnu.org; Mon, 13 Aug 2012 09:16:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0uV0-000341-Cn for qemu-devel@nongnu.org; Mon, 13 Aug 2012 09:16:08 -0400 Date: Mon, 13 Aug 2012 16:16:59 +0300 From: "Michael S. Tsirkin" Message-ID: <20120813131659.GE16801@redhat.com> References: <1343872026-18189-1-git-send-email-afaerber@suse.de> <1343872026-18189-15-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1343872026-18189-15-git-send-email-afaerber@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-1.2 v5 14/14] pci: Tidy up PCI host bridges List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: qemu-devel@nongnu.org, Alexander Graf , Andreas =?iso-8859-1?Q?F=E4rber?= , "open list:New World" , anthony@codemonkey.ws, Scott Wood , David Gibson On Thu, Aug 02, 2012 at 03:47:06AM +0200, Andreas F=E4rber wrote: > Uglify the parent field to enforce QOM-style access via casts. > Don't just typedef PCIHostState, either use it directly or embed it. >=20 > Signed-off-by: Andreas F=E4rber IMHO only one chunk from this patch should be applied (below). Below it is split out but needs to be rebased on top of patches 1-13. --> From: Andreas F=E4rber piix: minor code simplification There's no need to deal with qdev internals in piix - we get device state from qdev_create so just use that. Signed-off-by: Andreas F=E4rber Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/piix_pci.c b/hw/piix_pci.c index c497a01..18554a6 100644 --- a/hw/piix_pci.c +++ b/hw/piix_pci.c @@ -274,7 +274,7 @@ static PCIBus *i440fx_common_init(const char *device_= name, dev =3D qdev_create(NULL, "i440FX-pcihost"); s =3D FROM_SYSBUS(I440FXState, sysbus_from_qdev(dev)); s->address_space =3D address_space_mem; - b =3D pci_bus_new(&s->busdev.qdev, NULL, pci_address_space, + b =3D pci_bus_new(&dev, NULL, pci_address_space, address_space_io, 0); s->bus =3D b; object_property_add_child(qdev_get_machine(), "i440fx", OBJECT(dev),= NULL);