OSDN Git Service

spapr: Rework DRC name handling
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 7 Jun 2017 02:00:11 +0000 (12:00 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 8 Jun 2017 04:38:27 +0000 (14:38 +1000)
commit798083361950ec3fed946bbcf22c924ef820e45e
tree5a0e10c07abe88f05f87d69335a15b7739b2900c
parent6304fd27ef9f13e00d6f4ac4a56dced69ee82c3f
spapr: Rework DRC name handling

DRC objects have a get_name method which returns the DRC name generated
when the DRC is created.  Replace that with a fixed spapr_drc_name()
function which generates the name on the fly from other information.  This
means:
  * We get rid of a method with only one implementation, and only local
    callers
  * We don't have to carry the name string around for the lifetime of the
    DRC
  * We use information added to the class structure to generate the name
    in standard format, so we don't need an explicit switch on drc type
    any more

We also eliminate the 'name' property; it's basically useless since the
only information in it can easily be deduced from other things.

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_drc.c
include/hw/ppc/spapr_drc.h