On Thu, Feb 05, 2015 at 15:47:52 +0100, Ján Tomko wrote:
Allowing their use with x86Data* helpers for easier filtering.
---
src/cpu/cpu_x86.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 45be262..f6e8eec 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -90,6 +90,7 @@ struct x86_map {
struct x86_feature *features;
struct x86_model *models;
struct x86_feature *migrate_blockers;
+ virCPUx86Data *migrate_blocker_data;
};
static struct x86_map* virCPUx86Map;
@@ -689,6 +690,36 @@ x86ParseCPUID(xmlXPathContextPtr ctxt,
}
+static virCPUx86Data *
+x86DataFromCPUFeatureList(const struct x86_feature *list,
+ const struct x86_map *map)
+{
+ virCPUx86Data *data;
+ const struct x86_feature *feat;
+
+ if (VIR_ALLOC(data) < 0)
+ return NULL;
+
+ for (feat = list; feat; feat = feat->next) {
+ const struct x86_feature *feature;
+ if (!(feature = x86FeatureFind(map, feat->name))) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown CPU feature %s"), feat->name);
+ goto error;
+ }
This is just weired. We already have migrate_blockers list of
x86_feature structs so having migrate_blocker_data here as well seems
pretty redundant. Not to mention that we go through the migrate_blockers
list and search for each of the feature in the features list to get the
data? This doesn't sound right.
Jirka