Skip to content

hw: Fix abuse of QOM class internals modified by their instances

Philippe Mathieu-Daudé qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3hw/mips/jazz: Fix modifying QOM class internal state from instancehw/mips/jazz.c+23 -181 reply
2/3hw/ppc/e500plat: Fix modifying QOM class internal state from instancehw/ppc/e500plat.c+11 -142 replies
3/3hw/i2c/pmbus_device: Fix modifying QOM class internals from instancehw/i2c/pmbus_device.c+10 -71 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchBernhard BeschowRichard Henderson
1/3Inspired-by R-b
2/3Inspired-by R-b
3/3Inspired-by R-b

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

Read the v1 thread

Cover letter [PATCH 0/3] hw: Fix abuse of QOM class internals modified by their instances

Bernhard warned for QOM class abuse here [*]:

Quoted 5 lines

A realize method is supposed to modify a single instance only while we're modifying the behavior of whole classes here, i.e. will affect every instance of these classes. This goes against QOM design principles and will therefore be confusing for people who are familiar with QOM in particular and OOP in general.

This series fixes the cases I found while auditing.

[*] https://lore.kernel.org/qemu-devel/[email protected]/

Philippe Mathieu-Daudé (3):
hw/mips/jazz: Fix modifying QOM class internal state from instance hw/ppc/e500plat: Fix modifying QOM class internal state from instance hw/i2c/pmbus_device: Fix modifying QOM class internals from instance

 hw/i2c/pmbus_device.c | 17 ++++++++++-------
 hw/mips/jazz.c        | 41 +++++++++++++++++++++++------------------
 hw/ppc/e500plat.c     | 25 +++++++++++--------------
 3 files changed, 44 insertions(+), 39 deletions(-)
Signature · 1 line
2.38.1