virCPUx86ModelPtr next;
};
-struct x86_map {
+typedef struct _virCPUx86Map virCPUx86Map;
+typedef virCPUx86Map *virCPUx86MapPtr;
+struct _virCPUx86Map {
virCPUx86VendorPtr vendors;
virCPUx86FeaturePtr features;
virCPUx86ModelPtr models;
virCPUx86FeaturePtr migrate_blockers;
};
-static struct x86_map* virCPUx86Map;
+static virCPUx86MapPtr cpuMap;
int virCPUx86MapOnceInit(void);
VIR_ONCE_GLOBAL_INIT(virCPUx86Map);
x86DataToCPUFeatures(virCPUDefPtr cpu,
int policy,
virCPUx86Data *data,
- const struct x86_map *map)
+ virCPUx86MapPtr map)
{
virCPUx86FeaturePtr feature = map->features;
/* also removes bits corresponding to vendor string from data */
static virCPUx86VendorPtr
x86DataToVendor(virCPUx86Data *data,
- const struct x86_map *map)
+ virCPUx86MapPtr map)
{
virCPUx86VendorPtr vendor = map->vendors;
virCPUx86CPUID *cpuid;
static virCPUDefPtr
x86DataToCPU(const virCPUx86Data *data,
virCPUx86ModelPtr model,
- const struct x86_map *map)
+ virCPUx86MapPtr map)
{
virCPUDefPtr cpu;
virCPUx86Data *copy = NULL;
static virCPUx86VendorPtr
-x86VendorFind(const struct x86_map *map,
+x86VendorFind(virCPUx86MapPtr map,
const char *name)
{
virCPUx86VendorPtr vendor;
static int
x86VendorLoad(xmlXPathContextPtr ctxt,
- struct x86_map *map)
+ virCPUx86MapPtr map)
{
virCPUx86VendorPtr vendor = NULL;
char *string = NULL;
static virCPUx86FeaturePtr
-x86FeatureFind(const struct x86_map *map,
+x86FeatureFind(virCPUx86MapPtr map,
const char *name)
{
virCPUx86FeaturePtr feature;
static char *
-x86FeatureNames(const struct x86_map *map,
+x86FeatureNames(virCPUx86MapPtr map,
const char *separator,
virCPUx86Data *data)
{
static int
x86FeatureLoad(xmlXPathContextPtr ctxt,
- struct x86_map *map)
+ virCPUx86MapPtr map)
{
xmlNodePtr *nodes = NULL;
xmlNodePtr ctxt_node = ctxt->node;
static virCPUx86Data *
x86DataFromCPUFeatures(virCPUDefPtr cpu,
- const struct x86_map *map)
+ virCPUx86MapPtr map)
{
virCPUx86Data *data;
size_t i;
static virCPUx86ModelPtr
-x86ModelFind(const struct x86_map *map,
+x86ModelFind(virCPUx86MapPtr map,
const char *name)
{
virCPUx86ModelPtr model;
static virCPUx86ModelPtr
x86ModelFromCPU(const virCPUDef *cpu,
- const struct x86_map *map,
+ virCPUx86MapPtr map,
int policy)
{
virCPUx86ModelPtr model = NULL;
static int
x86ModelSubtractCPU(virCPUx86ModelPtr model,
const virCPUDef *cpu,
- const struct x86_map *map)
+ virCPUx86MapPtr map)
{
virCPUx86ModelPtr cpu_model;
size_t i;
static int
x86ModelLoad(xmlXPathContextPtr ctxt,
- struct x86_map *map)
+ virCPUx86MapPtr map)
{
xmlNodePtr *nodes = NULL;
virCPUx86ModelPtr model;
static void
-x86MapFree(struct x86_map *map)
+x86MapFree(virCPUx86MapPtr map)
{
if (map == NULL)
return;
xmlXPathContextPtr ctxt,
void *data)
{
- struct x86_map *map = data;
+ virCPUx86MapPtr map = data;
switch (element) {
case CPU_MAP_ELEMENT_VENDOR:
static int
-x86MapLoadInternalFeatures(struct x86_map *map)
+x86MapLoadInternalFeatures(virCPUx86MapPtr map)
{
size_t i;
virCPUx86FeaturePtr feature = NULL;
}
-static struct x86_map *
+static virCPUx86MapPtr
virCPUx86LoadMap(void)
{
- struct x86_map *map;
+ virCPUx86MapPtr map;
if (VIR_ALLOC(map) < 0)
return NULL;
int
virCPUx86MapOnceInit(void)
{
- if (!(virCPUx86Map = virCPUx86LoadMap()))
+ if (!(cpuMap = virCPUx86LoadMap()))
return -1;
return 0;
}
-static const struct x86_map *
+static virCPUx86MapPtr
virCPUx86GetMap(void)
{
if (virCPUx86MapInitialize() < 0)
return NULL;
- return virCPUx86Map;
+ return cpuMap;
}
virCPUDataPtr *guest,
char **message)
{
- const struct x86_map *map = NULL;
+ virCPUx86MapPtr map = NULL;
virCPUx86ModelPtr host_model = NULL;
virCPUx86ModelPtr cpu_force = NULL;
virCPUx86ModelPtr cpu_require = NULL;
unsigned int flags)
{
int ret = -1;
- const struct x86_map *map;
+ virCPUx86MapPtr map;
virCPUx86ModelPtr candidate;
virCPUDefPtr cpuCandidate;
virCPUDefPtr cpuModel = NULL;
static virCPUx86Data *
x86EncodePolicy(const virCPUDef *cpu,
- const struct x86_map *map,
+ virCPUx86MapPtr map,
virCPUFeaturePolicy policy)
{
virCPUx86ModelPtr model;
virCPUDataPtr *forbidden,
virCPUDataPtr *vendor)
{
- const struct x86_map *map = NULL;
+ virCPUx86MapPtr map = NULL;
virCPUx86Data *data_forced = NULL;
virCPUx86Data *data_required = NULL;
virCPUx86Data *data_optional = NULL;
unsigned int nmodels,
unsigned int flags)
{
- const struct x86_map *map = NULL;
+ virCPUx86MapPtr map = NULL;
virCPUx86ModelPtr base_model = NULL;
virCPUDefPtr cpu = NULL;
size_t i;
{
int ret = -1;
size_t i;
- const struct x86_map *map;
+ virCPUx86MapPtr map;
virCPUx86ModelPtr host_model = NULL;
if (!(map = virCPUx86GetMap()) ||
bool passthrough)
{
virCPUDefPtr oldguest = NULL;
- const struct x86_map *map;
+ virCPUx86MapPtr map;
virCPUx86FeaturePtr feat;
size_t i;
int ret = -1;
x86HasFeature(const virCPUData *data,
const char *name)
{
- const struct x86_map *map;
+ virCPUx86MapPtr map;
virCPUx86FeaturePtr feature;
int ret = -1;
static int
x86GetModels(char ***models)
{
- const struct x86_map *map;
+ virCPUx86MapPtr map;
virCPUx86ModelPtr model;
char *name;
size_t nmodels = 0;