From f48120d7df0abb0fba08e8f42e7f135981ab5011 Mon Sep 17 00:00:00 2001
Message-Id: <f48120d7df0abb0fba08e8f42e7f135981ab5011@dist-git>
From: Andrea Bolognani <abologna@redhat.com>
Date: Tue, 11 Aug 2015 17:15:53 +0200
Subject: [PATCH] cpu: Mark driver functions in ppc64 driver
Use the ppc64Driver prefix for all functions that are used to
fill in the cpuDriverPPC64 structure, ie. those that are going
to be called by the generic CPU code.
This makes it clear which functions are exported and which are
implementation details; it also gets rid of the ambiguity that
affected the ppc64DataFree() function which, despite what the
name suggested, was not related to ppc64DataCopy() and could
not be used to release the memory allocated for a
virCPUppc64Data* instance.
No functional changes.
(cherry picked from commit 2686bf229247279da79505238b001cf45e0b6950)
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
src/cpu/cpu_ppc64.c | 62 ++++++++++++++++++++++++++---------------------------
1 file changed, 31 insertions(+), 31 deletions(-)
diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
index c3a51fb..5140297 100644
--- a/src/cpu/cpu_ppc64.c
+++ b/src/cpu/cpu_ppc64.c
@@ -448,9 +448,9 @@ ppc64Compute(virCPUDefPtr host,
}
static virCPUCompareResult
-ppc64Compare(virCPUDefPtr host,
- virCPUDefPtr cpu,
- bool failIncompatible)
+ppc64DriverCompare(virCPUDefPtr host,
+ virCPUDefPtr cpu,
+ bool failIncompatible)
{
if ((cpu->arch == VIR_ARCH_NONE || host->arch == cpu->arch) &&
STREQ(host->model, cpu->model))
@@ -465,12 +465,12 @@ ppc64Compare(virCPUDefPtr host,
}
static int
-ppc64Decode(virCPUDefPtr cpu,
- const virCPUData *data,
- const char **models,
- unsigned int nmodels,
- const char *preferred ATTRIBUTE_UNUSED,
- unsigned int flags)
+ppc64DriverDecode(virCPUDefPtr cpu,
+ const virCPUData *data,
+ const char **models,
+ unsigned int nmodels,
+ const char *preferred ATTRIBUTE_UNUSED,
+ unsigned int flags)
{
int ret = -1;
struct ppc64_map *map;
@@ -510,7 +510,7 @@ ppc64Decode(virCPUDefPtr cpu,
static void
-ppc64DataFree(virCPUDataPtr data)
+ppc64DriverFree(virCPUDataPtr data)
{
if (data == NULL)
return;
@@ -519,7 +519,7 @@ ppc64DataFree(virCPUDataPtr data)
}
static virCPUDataPtr
-ppc64NodeData(virArch arch)
+ppc64DriverNodeData(virArch arch)
{
virCPUDataPtr cpuData;
@@ -537,17 +537,17 @@ ppc64NodeData(virArch arch)
}
static virCPUCompareResult
-ppc64GuestData(virCPUDefPtr host,
- virCPUDefPtr guest,
- virCPUDataPtr *data,
- char **message)
+ppc64DriverGuestData(virCPUDefPtr host,
+ virCPUDefPtr guest,
+ virCPUDataPtr *data,
+ char **message)
{
return ppc64Compute(host, guest, data, message);
}
static int
-ppc64Update(virCPUDefPtr guest,
- const virCPUDef *host)
+ppc64DriverUpdate(virCPUDefPtr guest,
+ const virCPUDef *host)
{
switch ((virCPUMode) guest->mode) {
case VIR_CPU_MODE_HOST_MODEL:
@@ -569,11 +569,11 @@ ppc64Update(virCPUDefPtr guest,
}
static virCPUDefPtr
-ppc64Baseline(virCPUDefPtr *cpus,
- unsigned int ncpus,
- const char **models ATTRIBUTE_UNUSED,
- unsigned int nmodels ATTRIBUTE_UNUSED,
- unsigned int flags)
+ppc64DriverBaseline(virCPUDefPtr *cpus,
+ unsigned int ncpus,
+ const char **models ATTRIBUTE_UNUSED,
+ unsigned int nmodels ATTRIBUTE_UNUSED,
+ unsigned int flags)
{
struct ppc64_map *map = NULL;
const struct ppc64_model *model;
@@ -653,7 +653,7 @@ ppc64Baseline(virCPUDefPtr *cpus,
}
static int
-ppc64GetModels(char ***models)
+ppc64DriverGetModels(char ***models)
{
struct ppc64_map *map;
struct ppc64_model *model;
@@ -699,14 +699,14 @@ struct cpuArchDriver cpuDriverPPC64 = {
.name = "ppc64",
.arch = archs,
.narch = ARRAY_CARDINALITY(archs),
- .compare = ppc64Compare,
- .decode = ppc64Decode,
+ .compare = ppc64DriverCompare,
+ .decode = ppc64DriverDecode,
.encode = NULL,
- .free = ppc64DataFree,
- .nodeData = ppc64NodeData,
- .guestData = ppc64GuestData,
- .baseline = ppc64Baseline,
- .update = ppc64Update,
+ .free = ppc64DriverFree,
+ .nodeData = ppc64DriverNodeData,
+ .guestData = ppc64DriverGuestData,
+ .baseline = ppc64DriverBaseline,
+ .update = ppc64DriverUpdate,
.hasFeature = NULL,
- .getModels = ppc64GetModels,
+ .getModels = ppc64DriverGetModels,
};
--
2.5.0