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>
This commit is contained in:
parent
6304fd27ef
commit
7980833619
2 changed files with 30 additions and 53 deletions
|
|
@ -184,7 +184,6 @@ typedef struct sPAPRDRConnector {
|
|||
|
||||
uint32_t id;
|
||||
Object *owner;
|
||||
const char *name;
|
||||
|
||||
/* DR-indicator */
|
||||
uint32_t dr_indicator;
|
||||
|
|
@ -215,6 +214,7 @@ typedef struct sPAPRDRConnectorClass {
|
|||
/*< public >*/
|
||||
sPAPRDRConnectorTypeShift typeshift;
|
||||
const char *typename; /* used in device tree, PAPR 13.5.2.6 & C.6.1 */
|
||||
const char *drc_name_prefix; /* used other places in device tree */
|
||||
|
||||
sPAPRDREntitySense (*dr_entity_sense)(sPAPRDRConnector *drc);
|
||||
|
||||
|
|
@ -223,7 +223,6 @@ typedef struct sPAPRDRConnectorClass {
|
|||
sPAPRDRIsolationState state);
|
||||
uint32_t (*set_allocation_state)(sPAPRDRConnector *drc,
|
||||
sPAPRDRAllocationState state);
|
||||
const char *(*get_name)(sPAPRDRConnector *drc);
|
||||
|
||||
/* QEMU interfaces for managing hotplug operations */
|
||||
bool (*release_pending)(sPAPRDRConnector *drc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue