qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] hw: Fix abuse of QOM class internals modified by their instances
@ 2023-05-23  6:44 Philippe Mathieu-Daudé
  2023-05-23  6:44 ` [PATCH 1/3] hw/mips/jazz: Fix modifying QOM class internal state from instance Philippe Mathieu-Daudé
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-05-23  6:44 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bernhard Beschow, Hervé Poussineau, Aleksandar Rikalo,
	Jiaxun Yang, qemu-ppc, Titus Rwantare,
	Philippe Mathieu-Daudé

Bernhard warned for QOM class abuse here [*]:

> 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/0DAAC63B-0C0F-44C4-B7EB-ACD6C9A36BF1@gmail.com/

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(-)

-- 
2.38.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-05-23 18:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-23  6:44 [PATCH 0/3] hw: Fix abuse of QOM class internals modified by their instances Philippe Mathieu-Daudé
2023-05-23  6:44 ` [PATCH 1/3] hw/mips/jazz: Fix modifying QOM class internal state from instance Philippe Mathieu-Daudé
2023-05-23 18:26   ` Richard Henderson
2023-05-23  6:44 ` [PATCH 2/3] hw/ppc/e500plat: " Philippe Mathieu-Daudé
2023-05-23  9:03   ` Alexander Graf
2023-05-23 18:29   ` Richard Henderson
2023-05-23  6:44 ` [PATCH 3/3] hw/i2c/pmbus_device: Fix modifying QOM class internals " Philippe Mathieu-Daudé
2023-05-23 18:30   ` Richard Henderson
2023-05-23  7:10 ` [PATCH 0/3] hw: Fix abuse of QOM class internals modified by their instances Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).