Blame SOURCES/kvm-ppc-spapr-caps-Change-migration-macro-to-take-full-s.patch

c7c90d
From 798cff99adef284cd804b031a4e4004016fd1f0b Mon Sep 17 00:00:00 2001
c7c90d
From: Suraj Jitindar Singh <sursingh@redhat.com>
c7c90d
Date: Tue, 13 Mar 2018 05:21:29 +0100
c7c90d
Subject: [PATCH 07/17] ppc/spapr-caps: Change migration macro to take full
c7c90d
 spapr-cap name
c7c90d
c7c90d
RH-Author: Suraj Jitindar Singh <sursingh@redhat.com>
c7c90d
Message-id: <1520918499-27663-2-git-send-email-sursingh@redhat.com>
c7c90d
Patchwork-id: 79245
c7c90d
O-Subject: [RHEL7.5 qemu-kvm-rhev PATCH 01/11] ppc/spapr-caps: Change migration macro to take full spapr-cap name
c7c90d
Bugzilla: 1554957
c7c90d
RH-Acked-by: David Gibson <dgibson@redhat.com>
c7c90d
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
c7c90d
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
c7c90d
c7c90d
From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
c7c90d
c7c90d
Change the macro that generates the vmstate migration field and the needed
c7c90d
function for the spapr-caps to take the full spapr-cap name. This has
c7c90d
the benefit of meaning this instance will be picked up when greping
c7c90d
for the spapr-caps and making it more obvious what this macro is doing.
c7c90d
c7c90d
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
c7c90d
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
c7c90d
(cherry picked from commit 8c5909c41916f25b47bfdc465059a926603c1319)
c7c90d
c7c90d
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1548919
c7c90d
c7c90d
Signed-off-by: Suraj Jitindar Singh <sursingh@redhat.com>
c7c90d
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
c7c90d
---
c7c90d
 hw/ppc/spapr_caps.c | 30 +++++++++++++++---------------
c7c90d
 1 file changed, 15 insertions(+), 15 deletions(-)
c7c90d
c7c90d
diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
c7c90d
index 62efdae..e69d308 100644
c7c90d
--- a/hw/ppc/spapr_caps.c
c7c90d
+++ b/hw/ppc/spapr_caps.c
c7c90d
@@ -350,34 +350,34 @@ int spapr_caps_post_migration(sPAPRMachineState *spapr)
c7c90d
 }
c7c90d
 
c7c90d
 /* Used to generate the migration field and needed function for a spapr cap */
c7c90d
-#define SPAPR_CAP_MIG_STATE(cap, ccap)                  \
c7c90d
-static bool spapr_cap_##cap##_needed(void *opaque)      \
c7c90d
+#define SPAPR_CAP_MIG_STATE(sname, cap)                 \
c7c90d
+static bool spapr_cap_##sname##_needed(void *opaque)    \
c7c90d
 {                                                       \
c7c90d
     sPAPRMachineState *spapr = opaque;                  \
c7c90d
                                                         \
c7c90d
-    return spapr->cmd_line_caps[SPAPR_CAP_##ccap] &&    \
c7c90d
-           (spapr->eff.caps[SPAPR_CAP_##ccap] !=        \
c7c90d
-            spapr->def.caps[SPAPR_CAP_##ccap]);         \
c7c90d
+    return spapr->cmd_line_caps[cap] &&                 \
c7c90d
+           (spapr->eff.caps[cap] !=                     \
c7c90d
+            spapr->def.caps[cap]);                      \
c7c90d
 }                                                       \
c7c90d
                                                         \
c7c90d
-const VMStateDescription vmstate_spapr_cap_##cap = {    \
c7c90d
-    .name = "spapr/cap/" #cap,                          \
c7c90d
+const VMStateDescription vmstate_spapr_cap_##sname = {  \
c7c90d
+    .name = "spapr/cap/" #sname,                        \
c7c90d
     .version_id = 1,                                    \
c7c90d
     .minimum_version_id = 1,                            \
c7c90d
-    .needed = spapr_cap_##cap##_needed,                 \
c7c90d
+    .needed = spapr_cap_##sname##_needed,               \
c7c90d
     .fields = (VMStateField[]) {                        \
c7c90d
-        VMSTATE_UINT8(mig.caps[SPAPR_CAP_##ccap],       \
c7c90d
+        VMSTATE_UINT8(mig.caps[cap],                    \
c7c90d
                       sPAPRMachineState),               \
c7c90d
         VMSTATE_END_OF_LIST()                           \
c7c90d
     },                                                  \
c7c90d
 }
c7c90d
 
c7c90d
-SPAPR_CAP_MIG_STATE(htm, HTM);
c7c90d
-SPAPR_CAP_MIG_STATE(vsx, VSX);
c7c90d
-SPAPR_CAP_MIG_STATE(dfp, DFP);
c7c90d
-SPAPR_CAP_MIG_STATE(cfpc, CFPC);
c7c90d
-SPAPR_CAP_MIG_STATE(sbbc, SBBC);
c7c90d
-SPAPR_CAP_MIG_STATE(ibs, IBS);
c7c90d
+SPAPR_CAP_MIG_STATE(htm, SPAPR_CAP_HTM);
c7c90d
+SPAPR_CAP_MIG_STATE(vsx, SPAPR_CAP_VSX);
c7c90d
+SPAPR_CAP_MIG_STATE(dfp, SPAPR_CAP_DFP);
c7c90d
+SPAPR_CAP_MIG_STATE(cfpc, SPAPR_CAP_CFPC);
c7c90d
+SPAPR_CAP_MIG_STATE(sbbc, SPAPR_CAP_SBBC);
c7c90d
+SPAPR_CAP_MIG_STATE(ibs, SPAPR_CAP_IBS);
c7c90d
 
c7c90d
 void spapr_caps_reset(sPAPRMachineState *spapr)
c7c90d
 {
c7c90d
-- 
c7c90d
1.8.3.1
c7c90d