From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ux61R-0002oF-KI for qemu-devel@nongnu.org; Wed, 10 Jul 2013 21:50:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ux61Q-0005M2-LO for qemu-devel@nongnu.org; Wed, 10 Jul 2013 21:50:17 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]:50072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ux61Q-0005Lx-F6 for qemu-devel@nongnu.org; Wed, 10 Jul 2013 21:50:16 -0400 Received: by mail-pb0-f47.google.com with SMTP id rr13so7233680pbb.20 for ; Wed, 10 Jul 2013 18:50:15 -0700 (PDT) Sender: Peter Crosthwaite From: peter.crosthwaite@xilinx.com Date: Thu, 11 Jul 2013 11:45:16 +1000 Message-Id: Subject: [Qemu-devel] [PATCH qom-next v2 0/5] QOM Super class access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: afaerber@suse.de Cc: hutao@cn.fujitsu.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, mst@redhat.com From: Peter Crosthwaite 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