On Thu, Aug 02, 2012 at 03:47:06AM +0200, Andreas Färber wrote:
> Uglify the parent field to enforce QOM-style access via casts.
> Don't just typedef PCIHostState, either use it directly or embed it.
> 
> Signed-off-by: Andreas Färber <afaer...@suse.de>


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ärber <andreas.faer...@web.de>

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ärber <andreas.faer...@web.de>
Signed-off-by: Michael S. Tsirkin <m...@redhat.com>

---

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 = qdev_create(NULL, "i440FX-pcihost");
     s = FROM_SYSBUS(I440FXState, sysbus_from_qdev(dev));
     s->address_space = address_space_mem;
-    b = pci_bus_new(&s->busdev.qdev, NULL, pci_address_space,
+    b = pci_bus_new(&dev, NULL, pci_address_space,
                     address_space_io, 0);
     s->bus = b;
     object_property_add_child(qdev_get_machine(), "i440fx", OBJECT(dev), NULL);

Reply via email to