[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 06/14] ppc/spapr-caps: Change migration macro to take f
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 06/14] ppc/spapr-caps: Change migration macro to take full spapr-cap name |
Date: |
Fri, 16 Feb 2018 21:06:09 +1100 |
From: Suraj Jitindar Singh <address@hidden>
Change the macro that generates the vmstate migration field and the needed
function for the spapr-caps to take the full spapr-cap name. This has
the benefit of meaning this instance will be picked up when greping
for the spapr-caps and making it more obvious what this macro is doing.
Signed-off-by: Suraj Jitindar Singh <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_caps.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
index 62efdaee38..e69d308560 100644
--- a/hw/ppc/spapr_caps.c
+++ b/hw/ppc/spapr_caps.c
@@ -350,34 +350,34 @@ int spapr_caps_post_migration(sPAPRMachineState *spapr)
}
/* Used to generate the migration field and needed function for a spapr cap */
-#define SPAPR_CAP_MIG_STATE(cap, ccap) \
-static bool spapr_cap_##cap##_needed(void *opaque) \
+#define SPAPR_CAP_MIG_STATE(sname, cap) \
+static bool spapr_cap_##sname##_needed(void *opaque) \
{ \
sPAPRMachineState *spapr = opaque; \
\
- return spapr->cmd_line_caps[SPAPR_CAP_##ccap] && \
- (spapr->eff.caps[SPAPR_CAP_##ccap] != \
- spapr->def.caps[SPAPR_CAP_##ccap]); \
+ return spapr->cmd_line_caps[cap] && \
+ (spapr->eff.caps[cap] != \
+ spapr->def.caps[cap]); \
} \
\
-const VMStateDescription vmstate_spapr_cap_##cap = { \
- .name = "spapr/cap/" #cap, \
+const VMStateDescription vmstate_spapr_cap_##sname = { \
+ .name = "spapr/cap/" #sname, \
.version_id = 1, \
.minimum_version_id = 1, \
- .needed = spapr_cap_##cap##_needed, \
+ .needed = spapr_cap_##sname##_needed, \
.fields = (VMStateField[]) { \
- VMSTATE_UINT8(mig.caps[SPAPR_CAP_##ccap], \
+ VMSTATE_UINT8(mig.caps[cap], \
sPAPRMachineState), \
VMSTATE_END_OF_LIST() \
}, \
}
-SPAPR_CAP_MIG_STATE(htm, HTM);
-SPAPR_CAP_MIG_STATE(vsx, VSX);
-SPAPR_CAP_MIG_STATE(dfp, DFP);
-SPAPR_CAP_MIG_STATE(cfpc, CFPC);
-SPAPR_CAP_MIG_STATE(sbbc, SBBC);
-SPAPR_CAP_MIG_STATE(ibs, IBS);
+SPAPR_CAP_MIG_STATE(htm, SPAPR_CAP_HTM);
+SPAPR_CAP_MIG_STATE(vsx, SPAPR_CAP_VSX);
+SPAPR_CAP_MIG_STATE(dfp, SPAPR_CAP_DFP);
+SPAPR_CAP_MIG_STATE(cfpc, SPAPR_CAP_CFPC);
+SPAPR_CAP_MIG_STATE(sbbc, SPAPR_CAP_SBBC);
+SPAPR_CAP_MIG_STATE(ibs, SPAPR_CAP_IBS);
void spapr_caps_reset(sPAPRMachineState *spapr)
{
--
2.14.3
- [Qemu-ppc] [PULL 00/14] ppc-for-2.12 queue 20180216, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 06/14] ppc/spapr-caps: Change migration macro to take full spapr-cap name,
David Gibson <=
- [Qemu-ppc] [PULL 04/14] hw/ppc/spapr_hcall: set htab_shift after kvmppc_resize_hpt_commit, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 13/14] ppc/spapr-caps: Disallow setting workaround for spapr-cap-ibs, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 08/14] spapr: move VCPU calculation to core machine code, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 09/14] spapr: rename spapr_vcpu_id() to spapr_get_vcpu_id(), David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 02/14] ppc: move CUDAState and other CUDA-related definitions into separate cuda.h file, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 12/14] target/ppc: convert to TranslatorOps, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 10/14] spapr: consolidate the VCPU id numbering logic in a single place, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 03/14] cuda: convert to trace-events, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 07/14] spapr: use spapr->vsmt to compute VCPU ids, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 05/14] hw/char: remove legacy interface escc_init(), David Gibson, 2018/02/16