virCPUx86VendorPtr next;
};
-struct x86_feature {
+typedef struct _virCPUx86Feature virCPUx86Feature;
+typedef virCPUx86Feature *virCPUx86FeaturePtr;
+struct _virCPUx86Feature {
char *name;
virCPUx86Data *data;
- struct x86_feature *next;
+ virCPUx86FeaturePtr next;
};
struct x86_kvm_feature {
struct x86_map {
virCPUx86VendorPtr vendors;
- struct x86_feature *features;
+ virCPUx86FeaturePtr features;
struct x86_model *models;
- struct x86_feature *migrate_blockers;
+ virCPUx86FeaturePtr migrate_blockers;
};
static struct x86_map* virCPUx86Map;
virCPUx86Data *data,
const struct x86_map *map)
{
- const struct x86_feature *feature = map->features;
+ virCPUx86FeaturePtr feature = map->features;
while (feature != NULL) {
if (x86DataIsSubset(data, feature->data)) {
}
-static struct x86_feature *
+static virCPUx86FeaturePtr
x86FeatureNew(void)
{
- struct x86_feature *feature;
+ virCPUx86FeaturePtr feature;
if (VIR_ALLOC(feature) < 0)
return NULL;
static void
-x86FeatureFree(struct x86_feature *feature)
+x86FeatureFree(virCPUx86FeaturePtr feature)
{
if (feature == NULL)
return;
}
-static struct x86_feature *
-x86FeatureCopy(const struct x86_feature *src)
+static virCPUx86FeaturePtr
+x86FeatureCopy(virCPUx86FeaturePtr src)
{
- struct x86_feature *feature;
+ virCPUx86FeaturePtr feature;
if (VIR_ALLOC(feature) < 0)
return NULL;
}
-static struct x86_feature *
+static virCPUx86FeaturePtr
x86FeatureFind(const struct x86_map *map,
const char *name)
{
- struct x86_feature *feature;
+ virCPUx86FeaturePtr feature;
feature = map->features;
while (feature != NULL) {
virBuffer ret = VIR_BUFFER_INITIALIZER;
bool first = true;
- struct x86_feature *next_feature = map->features;
+ virCPUx86FeaturePtr next_feature = map->features;
virBufferAdd(&ret, "", 0);
{
xmlNodePtr *nodes = NULL;
xmlNodePtr ctxt_node = ctxt->node;
- struct x86_feature *feature;
+ virCPUx86FeaturePtr feature;
virCPUx86CPUID cpuid;
int ret = 0;
size_t i;
int n;
char *str = NULL;
bool migratable = true;
- struct x86_feature *migrate_blocker = NULL;
+ virCPUx86FeaturePtr migrate_blocker = NULL;
if (!(feature = x86FeatureNew()))
goto error;
return NULL;
for (i = 0; i < cpu->nfeatures; i++) {
- const struct x86_feature *feature;
+ virCPUx86FeaturePtr feature;
if (!(feature = x86FeatureFind(map, cpu->features[i].name))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown CPU feature %s"), cpu->features[i].name);
}
for (i = 0; i < cpu->nfeatures; i++) {
- const struct x86_feature *feature;
+ virCPUx86FeaturePtr feature;
if (cpu->type == VIR_CPU_TYPE_GUEST
&& cpu->features[i].policy != policy)
x86DataSubtract(model->data, cpu_model->data);
for (i = 0; i < cpu->nfeatures; i++) {
- const struct x86_feature *feature;
+ virCPUx86FeaturePtr feature;
if (!(feature = x86FeatureFind(map, cpu->features[i].name))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
goto ignore;
for (i = 0; i < n; i++) {
- const struct x86_feature *feature;
+ virCPUx86FeaturePtr feature;
char *name;
if ((name = virXMLPropString(nodes[i], "name")) == NULL) {
return;
while (map->features != NULL) {
- struct x86_feature *feature = map->features;
+ virCPUx86FeaturePtr feature = map->features;
map->features = feature->next;
x86FeatureFree(feature);
}
}
while (map->migrate_blockers != NULL) {
- struct x86_feature *migrate_blocker = map->migrate_blockers;
+ virCPUx86FeaturePtr migrate_blocker = map->migrate_blockers;
map->migrate_blockers = migrate_blocker->next;
x86FeatureFree(migrate_blocker);
}
x86MapLoadInternalFeatures(struct x86_map *map)
{
size_t i;
- struct x86_feature *feature = NULL;
+ virCPUx86FeaturePtr feature = NULL;
for (i = 0; i < ARRAY_CARDINALITY(x86_kvm_features); i++) {
const char *name = x86_kvm_features[i].name;
* features directly */
if (flags & VIR_CONNECT_BASELINE_CPU_MIGRATABLE) {
for (i = 0; i < cpuModel->nfeatures; i++) {
- const struct x86_feature *feat;
+ virCPUx86FeaturePtr feat;
for (feat = map->migrate_blockers; feat; feat = feat->next) {
if (STREQ(feat->name, cpuModel->features[i].name)) {
VIR_FREE(cpuModel->features[i].name);
for (i = 0; i < guest->nfeatures; i++) {
if (guest->features[i].policy == VIR_CPU_FEATURE_OPTIONAL) {
- const struct x86_feature *feature;
+ virCPUx86FeaturePtr feature;
if (!(feature = x86FeatureFind(map, guest->features[i].name))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown CPU feature %s"),
{
virCPUDefPtr oldguest = NULL;
const struct x86_map *map;
- const struct x86_feature *feat;
+ virCPUx86FeaturePtr feat;
size_t i;
int ret = -1;
const char *name)
{
const struct x86_map *map;
- struct x86_feature *feature;
+ virCPUx86FeaturePtr feature;
int ret = -1;
if (!(map = virCPUx86GetMap()))