Skip to content

QOM Super class access

[email protected] qemu-devel 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 0 repliesNew
  2. v25 patches 8 repliesSuperseded
  3. v1 RFC7 patches 13 repliesSuperseded

Changes in v3 from the cover letter

Removed object_class_get_parent_by_name
introduce FOO_PARENT_CLASS macros

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4target-arm/cpu.c: delete un-needed instance/class sizestarget-arm/cpu.c+0 -20 replies
2/4target-arm: Use parent classes for reset + realizetarget-arm/cpu-qom.h target-arm/cpu.c+7 -290 replies
3/4target-microblaze: Use parent class for reset + realizetarget-microblaze/cpu-qom.h target-microblaze/cpu.c+6 -300 replies
4/4i8254: Use parent class for realizehw/i386/kvm/i8254.c hw/timer/i8254.c+8 -280 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchAndreas Färber
1/4R-b
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [Qemu-devel] [PATCH qom-next v3 0/4] QOM Super class access

From: Peter Crosthwaite <[email protected]>

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 V2:
Removed object_class_get_parent_by_name
introduce FOO_PARENT_CLASS macros
changed since V1:
Simplified to use object_class_get_parent_by_type (suggest by Hu Tao)

Peter Crosthwaite (4):
target-arm/cpu.c: delete un-needed instance/class sizes
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         | 19 ++++---------------
 hw/timer/i8254.c            | 17 ++++-------------
 target-arm/cpu-qom.h        | 22 ++--------------------
 target-arm/cpu.c            | 16 +++++-----------
 target-microblaze/cpu-qom.h | 22 ++--------------------
 target-microblaze/cpu.c     | 14 ++++----------
 6 files changed, 21 insertions(+), 89 deletions(-)
Signature · 1 line
1.8.3.rc1.44.gb387c77.dirty