Blame SOURCES/kvm-hw-ppc-spapr_drc.c-change-spapr_drc_needed-to-use-dr.patch

4a2fec
From 6984d8d007ed94067b37af90b1e20a0aad76a205 Mon Sep 17 00:00:00 2001
4a2fec
From: David Gibson <dgibson@redhat.com>
4a2fec
Date: Wed, 4 Oct 2017 05:40:11 +0200
4a2fec
Subject: [PATCH 04/34] hw/ppc/spapr_drc.c: change spapr_drc_needed to use
4a2fec
 drc->dev
4a2fec
4a2fec
RH-Author: David Gibson <dgibson@redhat.com>
4a2fec
Message-id: <20171004054014.14159-2-dgibson@redhat.com>
4a2fec
Patchwork-id: 76799
4a2fec
O-Subject: [RHEL-7.5 qemu-kvm-rhev PATCH 1/4] hw/ppc/spapr_drc.c: change spapr_drc_needed to use drc->dev
4a2fec
Bugzilla: 1448344
4a2fec
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
4a2fec
RH-Acked-by: Thomas Huth <thuth@redhat.com>
4a2fec
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
4a2fec
From: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
4a2fec
4a2fec
This patch makes a small fix in 'spapr_drc_needed' to change how we detect
4a2fec
if a DRC has a device attached. Previously it used dr_entity_sense for this,
4a2fec
which  works for physical DRCs.
4a2fec
4a2fec
However, for logical DRCs, it didn't cover the case where a logical DRC has
4a2fec
a drc->dev but the state is LOGICAL_UNUSABLE (e.g. a hotplugged CPU before
4a2fec
CAS). In this case, the dr_entity_sense of this DRC returns UNUSABLE and the
4a2fec
code was considering that there were no dev attached, making spapr_drc_needed
4a2fec
return 'false' when in fact we would like to migrate the DRC.
4a2fec
4a2fec
Changing it to check for drc->dev instead works for all DRC types.
4a2fec
4a2fec
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
4a2fec
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
4a2fec
(cherry picked from commit c618e300eb2276996e7004100686768cf1445128)
4a2fec
4a2fec
Signed-off-by: David Gibson <dgibson@redhat.com>
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 hw/ppc/spapr_drc.c | 3 +--
4a2fec
 1 file changed, 1 insertion(+), 2 deletions(-)
4a2fec
4a2fec
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
4a2fec
index 605697d..031ba7c 100644
4a2fec
--- a/hw/ppc/spapr_drc.c
4a2fec
+++ b/hw/ppc/spapr_drc.c
4a2fec
@@ -464,10 +464,9 @@ static bool spapr_drc_needed(void *opaque)
4a2fec
 {
4a2fec
     sPAPRDRConnector *drc = (sPAPRDRConnector *)opaque;
4a2fec
     sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
4a2fec
-    sPAPRDREntitySense value = drck->dr_entity_sense(drc);
4a2fec
 
4a2fec
     /* If no dev is plugged in there is no need to migrate the DRC state */
4a2fec
-    if (value != SPAPR_DR_ENTITY_SENSE_PRESENT) {
4a2fec
+    if (!drc->dev) {
4a2fec
         return false;
4a2fec
     }
4a2fec
 
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec