qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/22] vfio: improve use of QOM and coding guidelines
@ 2025-07-15  9:25 Mark Cave-Ayland
  2025-07-15  9:25 ` [PATCH 01/22] vfio/vfio-container-base.h: update VFIOContainerBase declaration Mark Cave-Ayland
                   ` (22 more replies)
  0 siblings, 23 replies; 73+ messages in thread
From: Mark Cave-Ayland @ 2025-07-15  9:25 UTC (permalink / raw)
  To: npiggin, danielhb413, harshpb, mjrosato, farman, pasic,
	borntraeger, thuth, richard.henderson, david, iii, john.levon,
	thanos.makatos, alex.williamson, clg, steven.sistare, tomitamoeko,
	qemu-ppc, qemu-s390x, qemu-devel

This series attempts to improve use of QOM within the vfio subsystem which
appears to have been added at a later date. It's mostly mechanical changes
that do the following:

  1) Format the QOM structs per our coding guidelines

  2) Ensure the parent object is called parent_obj

  3) Use QOM casts to access the parent object, instead of accessing
     the parent struct member directly

The benefits of this are that the QOM casts included type checking to help
ensure the right object is being passed into the cast, and it also becomes
much easier to infer the class hierarchy from reading the code.

Having produced this series, it feels to me that the readability could be
further improved by renaming the structs as follows:

   VFIOContainer     -> VFIOLegacyContainer
   VFIOContainerBase -> VFIOContainer

However I have left this for now given how close that we are to freeze.

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>


Mark Cave-Ayland (22):
  vfio/vfio-container-base.h: update VFIOContainerBase declaration
  vfio/vfio-container.h: update VFIOContainer declaration
  hw/vfio/cpr-legacy.c: use QOM casts where appropriate
  hw/vfio/container.c: use QOM casts where appropriate
  ppc/spapr_pci_vfio.c: use QOM casts where appropriate
  vfio/spapr.c: use QOM casts where appropriate
  vfio/vfio-container.h: rename VFIOContainer bcontainer field to
    parent_obj
  vfio-user/container.h: update VFIOUserContainer declaration
  vfio/container.c: use QOM casts where appropriate
  vfio-user/container.h: rename VFIOUserContainer bcontainer field to
    parent_obj
  vfio-user/pci.c: update VFIOUserPCIDevice declaration
  vfio-user/pci.c: use QOM casts where appropriate
  vfio-user/pci.c: rename VFIOUserPCIDevice device field to parent_obj
  vfio/pci.h: update VFIOPCIDevice declaration
  vfio/pci.h: use QOM casts where appropriate
  vfio/pci.c: use QOM casts where appropriate
  vfio/pci-quirks.c: use QOM casts where appropriate
  vfio/cpr.c: use QOM casts where appropriate
  vfio/igd.c: use QOM casts where appropriate
  vfio-user/pci.c: use QOM casts where appropriate
  s390x/s390-pci-vfio.c: use QOM casts where appropriate
  vfio/pci.h: rename VFIOPCIDevice pdev field to parent_obj

 hw/ppc/spapr_pci_vfio.c               |   2 +-
 hw/s390x/s390-pci-vfio.c              |  14 +-
 hw/vfio-user/container.c              |  26 ++--
 hw/vfio-user/container.h              |   7 +-
 hw/vfio-user/pci.c                    |  16 +-
 hw/vfio/container.c                   |  31 ++--
 hw/vfio/cpr-legacy.c                  |  14 +-
 hw/vfio/cpr.c                         |  10 +-
 hw/vfio/igd.c                         |  38 ++---
 hw/vfio/pci-quirks.c                  |  48 +++---
 hw/vfio/pci.c                         | 206 +++++++++++++++-----------
 hw/vfio/pci.h                         |   5 +-
 hw/vfio/spapr.c                       |  16 +-
 include/hw/vfio/vfio-container-base.h |  13 +-
 include/hw/vfio/vfio-container.h      |   7 +-
 15 files changed, 249 insertions(+), 204 deletions(-)

-- 
2.43.0



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

end of thread, other threads:[~2025-09-01 10:25 UTC | newest]

Thread overview: 73+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15  9:25 [PATCH 00/22] vfio: improve use of QOM and coding guidelines Mark Cave-Ayland
2025-07-15  9:25 ` [PATCH 01/22] vfio/vfio-container-base.h: update VFIOContainerBase declaration Mark Cave-Ayland
2025-08-11 11:45   ` Cédric Le Goater
2025-08-11 11:56   ` Cédric Le Goater
2025-08-29 11:10     ` Mark Cave-Ayland
2025-07-15  9:25 ` [PATCH 02/22] vfio/vfio-container.h: update VFIOContainer declaration Mark Cave-Ayland
2025-07-15  9:39   ` Philippe Mathieu-Daudé
2025-08-11 11:45   ` Cédric Le Goater
2025-07-15  9:25 ` [PATCH 03/22] hw/vfio/cpr-legacy.c: use QOM casts where appropriate Mark Cave-Ayland
2025-07-15 12:36   ` Steven Sistare
2025-08-11 11:45   ` Cédric Le Goater
2025-07-15  9:25 ` [PATCH 04/22] hw/vfio/container.c: " Mark Cave-Ayland
2025-08-11 12:19   ` Cédric Le Goater
2025-07-15  9:25 ` [PATCH 05/22] ppc/spapr_pci_vfio.c: " Mark Cave-Ayland
2025-07-16  7:58   ` Harsh Prateek Bora
2025-08-11 12:19   ` Cédric Le Goater
2025-07-15  9:25 ` [PATCH 06/22] vfio/spapr.c: " Mark Cave-Ayland
2025-07-16  8:01   ` Harsh Prateek Bora
2025-08-11 12:20   ` Cédric Le Goater
2025-07-15  9:25 ` [PATCH 07/22] vfio/vfio-container.h: rename VFIOContainer bcontainer field to parent_obj Mark Cave-Ayland
2025-07-15  9:39   ` Philippe Mathieu-Daudé
2025-08-11 12:23   ` Cédric Le Goater
2025-07-15  9:25 ` [PATCH 08/22] vfio-user/container.h: update VFIOUserContainer declaration Mark Cave-Ayland
2025-07-15  9:39   ` Philippe Mathieu-Daudé
2025-07-15 12:57   ` John Levon
2025-08-11 12:23   ` Cédric Le Goater
2025-07-15  9:25 ` [PATCH 09/22] vfio/container.c: use QOM casts where appropriate Mark Cave-Ayland
2025-07-15 14:13   ` John Levon
2025-08-28 15:14     ` Mark Cave-Ayland
2025-08-28 15:25       ` John Levon
2025-08-11 12:23   ` Cédric Le Goater
2025-07-15  9:25 ` [PATCH 10/22] vfio-user/container.h: rename VFIOUserContainer bcontainer field to parent_obj Mark Cave-Ayland
2025-07-15  9:41   ` Philippe Mathieu-Daudé
2025-07-15 14:13   ` John Levon
2025-08-11 12:23   ` Cédric Le Goater
2025-07-15  9:25 ` [PATCH 11/22] vfio-user/pci.c: update VFIOUserPCIDevice declaration Mark Cave-Ayland
2025-07-15  9:42   ` Philippe Mathieu-Daudé
2025-07-15  9:43     ` Philippe Mathieu-Daudé
2025-07-15 13:35   ` BALATON Zoltan
2025-07-15 14:15   ` John Levon
2025-08-11 12:24   ` Cédric Le Goater
2025-07-15  9:25 ` [PATCH 12/22] vfio-user/pci.c: use QOM casts where appropriate Mark Cave-Ayland
2025-07-15 14:15   ` John Levon
2025-07-15  9:25 ` [PATCH 13/22] vfio-user/pci.c: rename VFIOUserPCIDevice device field to parent_obj Mark Cave-Ayland
2025-07-15  9:42   ` Philippe Mathieu-Daudé
2025-07-15 14:15   ` John Levon
2025-08-11 12:25   ` Cédric Le Goater
2025-07-15  9:25 ` [PATCH 14/22] vfio/pci.h: update VFIOPCIDevice declaration Mark Cave-Ayland
2025-07-15  9:44   ` Philippe Mathieu-Daudé
2025-08-11 12:25   ` Cédric Le Goater
2025-07-15  9:25 ` [PATCH 15/22] vfio/pci.h: use QOM casts where appropriate Mark Cave-Ayland
2025-07-15  9:25 ` [PATCH 16/22] vfio/pci.c: " Mark Cave-Ayland
2025-07-15 13:38   ` BALATON Zoltan
2025-08-11 12:45     ` Cédric Le Goater
2025-08-29 11:13       ` Mark Cave-Ayland
2025-08-29 11:07     ` Mark Cave-Ayland
2025-08-29 14:31       ` BALATON Zoltan
2025-09-01 10:24       ` Cédric Le Goater
2025-07-15  9:25 ` [PATCH 17/22] vfio/pci-quirks.c: " Mark Cave-Ayland
2025-07-15  9:25 ` [PATCH 18/22] vfio/cpr.c: " Mark Cave-Ayland
2025-07-15 12:36   ` Steven Sistare
2025-07-15  9:25 ` [PATCH 19/22] vfio/igd.c: " Mark Cave-Ayland
2025-07-18 15:26   ` Tomita Moeko
2025-07-15  9:26 ` [PATCH 20/22] vfio-user/pci.c: " Mark Cave-Ayland
2025-07-15 14:17   ` John Levon
2025-07-15  9:26 ` [PATCH 21/22] s390x/s390-pci-vfio.c: " Mark Cave-Ayland
2025-07-15 13:29   ` Eric Farman
2025-07-15 14:19   ` Matthew Rosato
2025-07-15  9:26 ` [PATCH 22/22] vfio/pci.h: rename VFIOPCIDevice pdev field to parent_obj Mark Cave-Ayland
2025-07-15  9:44   ` Philippe Mathieu-Daudé
2025-07-15 12:36   ` Steven Sistare
2025-08-11 12:46   ` Cédric Le Goater
2025-07-15 14:31 ` [PATCH 00/22] vfio: improve use of QOM and coding guidelines Cédric Le Goater

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