From: Peter Crosthwaite <peter.crosthwa...@xilinx.com> This series enables QOM super class access and demostrates some usages. Replaces the save->override->call via FooClass technique, to reduce some of the boiler plate in recently fully QOMified devices.
Applied the change to ARM CPU, MB CPU and some of Andreas's recently QOMified i386 devices, all which have the save->override->call issue. ARMCPU I've done a brief test on and seems to work. ARM CPU was particularly difficult, as it has 3 layers of heirachy, where a non-concrete class (TYPE_ARM_CPU) need to super class itself (to TYPE_CPU). This sees the need for super-classers to specify their expected base class level. See patches for illustration. The main future work to the series is to apply the change pattern to the reset of the tree changed since V1: Simplified to use object_class_get_parent_by_type (suggest by Hu Tao) Peter Crosthwaite (5): target-arm/cpu.c: delete un-needed instance/class sizes qom/object: Add object_class_get_parent_by_name target-arm: Use parent classes for reset + realize target-microblaze: Use parent class for reset + realize i8254: Use parent class for realize hw/i386/kvm/i8254.c | 18 +++--------------- hw/timer/i8254.c | 17 +++-------------- include/qom/object.h | 9 +++++++++ qom/object.c | 5 +++++ target-arm/cpu-qom.h | 20 -------------------- target-arm/cpu.c | 18 +++++++----------- target-microblaze/cpu-qom.h | 20 -------------------- target-microblaze/cpu.c | 16 ++++++---------- 8 files changed, 33 insertions(+), 90 deletions(-) -- 1.8.3.rc1.44.gb387c77.dirty