]> git.proxmox.com Git - mirror_qemu.git/commit - hw/ppc/spapr_pci.c
spapr: Introduce DRC subclasses
authorDavid Gibson <david@gibson.dropbear.id.au>
Sun, 4 Jun 2017 10:25:17 +0000 (20:25 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 5 Jun 2017 23:23:46 +0000 (09:23 +1000)
commit2d33581899edcaba9b7e48def11c4ddfcd2423ec
treeb87f31deb4d65e238b93e3f7bdfba6ee07d1cfad
parenta32e900b8abf3541414ef192ef72b6381fde8d0c
spapr: Introduce DRC subclasses

Currently we only have a single QOM type for all DRCs, but lots of
places where we switch behaviour based on the DRC's PAPR defined type.
This is a poor use of our existing type system.

So, instead create QOM subclasses for each PAPR defined DRC type.  We
also introduce intermediate subclasses for physical and logical DRCs,
a division which will be useful later on.

Instead of being stored in the DRC object itself, the PAPR type is now
stored in the class structure.  There are still many places where we
switch directly on the PAPR type value, but this at least provides the
basis to start to remove those.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/ppc/spapr.c
hw/ppc/spapr_drc.c
hw/ppc/spapr_pci.c
include/hw/ppc/spapr_drc.h