Skip to content

Commit

Permalink
hw/ppc/spapr_drc.c: change spapr_drc_needed to use drc->dev
Browse files Browse the repository at this point in the history
This patch makes a small fix in 'spapr_drc_needed' to change how we detect
if a DRC has a device attached. Previously it used dr_entity_sense for this,
which  works for physical DRCs.

However, for logical DRCs, it didn't cover the case where a logical DRC has
a drc->dev but the state is LOGICAL_UNUSABLE (e.g. a hotplugged CPU before
CAS). In this case, the dr_entity_sense of this DRC returns UNUSABLE and the
code was considering that there were no dev attached, making spapr_drc_needed
return 'false' when in fact we would like to migrate the DRC.

Changing it to check for drc->dev instead works for all DRC types.

Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  • Loading branch information
danielhb authored and dgibson committed Sep 7, 2017
1 parent cda4a33 commit c618e30
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions hw/ppc/spapr_drc.c
Expand Up @@ -464,10 +464,9 @@ static bool spapr_drc_needed(void *opaque)
{
sPAPRDRConnector *drc = (sPAPRDRConnector *)opaque;
sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
sPAPRDREntitySense value = drck->dr_entity_sense(drc);

/* If no dev is plugged in there is no need to migrate the DRC state */
if (value != SPAPR_DR_ENTITY_SENSE_PRESENT) {
if (!drc->dev) {
return false;
}

Expand Down

0 comments on commit c618e30

Please sign in to comment.