[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 05/17] spapr: Abolish DRC set_configured method
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 05/17] spapr: Abolish DRC set_configured method |
Date: |
Tue, 6 Jun 2017 12:51:23 +1000 |
DRConnectorClass has a set_configured method, however:
* There is only one implementation, and only ever likely to be one
* There's exactly one caller, and that's (now) local
* The implementation is very straightforward
So abolish the method entirely, and just open-code what we need.
Signed-off-by: David Gibson <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Tested-by: Daniel Barboza <address@hidden>
---
hw/ppc/spapr_drc.c | 24 ++++++++----------------
include/hw/ppc/spapr_drc.h | 3 ---
2 files changed, 8 insertions(+), 19 deletions(-)
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index f5b7b68..693571a 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -199,18 +199,6 @@ static const char *get_name(sPAPRDRConnector *drc)
return drc->name;
}
-static void set_configured(sPAPRDRConnector *drc)
-{
- trace_spapr_drc_set_configured(get_index(drc));
-
- if (drc->isolation_state != SPAPR_DR_ISOLATION_STATE_UNISOLATED) {
- /* guest should be not configuring an isolated device */
- trace_spapr_drc_set_configured_skipping(get_index(drc));
- return;
- }
- drc->configured = true;
-}
-
/* has the guest been notified of device attachment? */
static void set_signalled(sPAPRDRConnector *drc)
{
@@ -745,7 +733,6 @@ static void spapr_dr_connector_class_init(ObjectClass *k,
void *data)
drck->get_index = get_index;
drck->get_type = get_type;
drck->get_name = get_name;
- drck->set_configured = set_configured;
drck->entity_sense = entity_sense;
drck->attach = attach;
drck->detach = detach;
@@ -1113,7 +1100,6 @@ static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
uint64_t wa_offset;
uint32_t drc_index;
sPAPRDRConnector *drc;
- sPAPRDRConnectorClass *drck;
sPAPRConfigureConnectorState *ccs;
sPAPRDRCCResponse resp = SPAPR_DR_CC_RESPONSE_CONTINUE;
int rc;
@@ -1133,7 +1119,6 @@ static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
goto out;
}
- drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
if (!drc->fdt) {
trace_spapr_rtas_ibm_configure_connector_missing_fdt(drc_index);
rc = SPAPR_DR_CC_RESPONSE_NOT_CONFIGURABLE;
@@ -1170,10 +1155,17 @@ static void rtas_ibm_configure_connector(PowerPCCPU
*cpu,
case FDT_END_NODE:
ccs->fdt_depth--;
if (ccs->fdt_depth == 0) {
+ sPAPRDRIsolationState state = drc->isolation_state;
/* done sending the device tree, don't need to track
* the state anymore
*/
- drck->set_configured(drc);
+ trace_spapr_drc_set_configured(get_index(drc));
+ if (state == SPAPR_DR_ISOLATION_STATE_UNISOLATED) {
+ drc->configured = true;
+ } else {
+ /* guest should be not configuring an isolated device */
+ trace_spapr_drc_set_configured_skipping(get_index(drc));
+ }
spapr_ccs_remove(spapr, ccs);
ccs = NULL;
resp = SPAPR_DR_CC_RESPONSE_SUCCESS;
diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
index 80db955..90f4953 100644
--- a/include/hw/ppc/spapr_drc.h
+++ b/include/hw/ppc/spapr_drc.h
@@ -177,9 +177,6 @@ typedef struct sPAPRDRConnectorClass {
uint32_t (*entity_sense)(sPAPRDRConnector *drc, sPAPRDREntitySense *state);
- /* QEMU interfaces for managing FDT/configure-connector */
- void (*set_configured)(sPAPRDRConnector *drc);
-
/* QEMU interfaces for managing hotplug operations */
void (*attach)(sPAPRDRConnector *drc, DeviceState *d, void *fdt,
int fdt_start_offset, bool coldplug, Error **errp);
--
2.9.4
- Re: [Qemu-ppc] [PULL 01/17] migration: remove register_savevm(), (continued)
- [Qemu-ppc] [PULL 07/17] target-ppc: Fix openpic timer read register offset, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 12/17] spapr/drc: don't migrate DRC of cold-plugged CPUs and LMBs, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 02/17] migration: Mark CPU states dirty before incoming migration/loadvm, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 10/17] ppc/pnv: check the return value of fdt_setprop(), David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 09/17] spapr_nvram: Check return value from blk_getlength(), David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 04/17] spapr: Abolish DRC get_fdt method, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 17/17] spapr: Remove some non-useful properties on DRC objects, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 05/17] spapr: Abolish DRC set_configured method,
David Gibson <=
- [Qemu-ppc] [PULL 03/17] spapr: Move DRC RTAS calls into spapr_drc.c, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 08/17] target/ppc: Fixup set_spr error in h_register_process_table, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 16/17] spapr: Eliminate spapr_drc_get_type_str(), David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 06/17] spapr: Make DRC get_index and get_type methods into plain functions, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 14/17] spapr: Clean up spapr_dr_connector_by_*(), David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 13/17] spapr: Introduce DRC subclasses, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 11/17] spapr: Allow boot from vhost-*-scsi backends, David Gibson, 2017/06/05
- [Qemu-ppc] [PULL 15/17] spapr: Move configure-connector state into DRC, David Gibson, 2017/06/05
- Re: [Qemu-ppc] [PULL 00/17] ppc-for-2.10 queue 20170606, Peter Maydell, 2017/06/06