static int
-x86ModelParse(xmlXPathContextPtr ctxt,
- const char *name,
- void *data)
+x86ModelParseSignature(virCPUx86ModelPtr model,
+ xmlXPathContextPtr ctxt)
{
- virCPUx86MapPtr map = data;
- xmlNodePtr *nodes = NULL;
- virCPUx86ModelPtr model;
- char *vendor = NULL;
- size_t i;
- int n;
- int ret = -1;
-
- if (!(model = x86ModelNew()))
- goto cleanup;
-
- if (VIR_STRDUP(model->name, name) < 0)
- goto cleanup;
-
- if (x86ModelParseAncestor(model, ctxt, map) < 0)
- goto cleanup;
if (virXPathBoolean("boolean(./signature)", ctxt)) {
unsigned int sigFamily = 0;
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid CPU signature family in model %s"),
model->name);
- goto cleanup;
+ return -1;
}
rc = virXPathUInt("string(./signature/@model)", ctxt, &sigModel);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid CPU signature model in model %s"),
model->name);
- goto cleanup;
+ return -1;
}
model->signature = x86MakeSignature(sigFamily, sigModel, 0);
}
+ return 0;
+}
+
+
+static int
+x86ModelParse(xmlXPathContextPtr ctxt,
+ const char *name,
+ void *data)
+{
+ virCPUx86MapPtr map = data;
+ xmlNodePtr *nodes = NULL;
+ virCPUx86ModelPtr model;
+ char *vendor = NULL;
+ size_t i;
+ int n;
+ int ret = -1;
+
+ if (!(model = x86ModelNew()))
+ goto cleanup;
+
+ if (VIR_STRDUP(model->name, name) < 0)
+ goto cleanup;
+
+ if (x86ModelParseAncestor(model, ctxt, map) < 0)
+ goto cleanup;
+
+ if (x86ModelParseSignature(model, ctxt) < 0)
+ goto cleanup;
+
if (virXPathBoolean("boolean(./vendor)", ctxt)) {
vendor = virXPathString("string(./vendor/@name)", ctxt);
if (!vendor) {