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

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