mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virCPUDefParseXML: Use virXMLProp*
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
324f6f5826
commit
f0379bdd14
@ -423,7 +423,6 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
|
|||||||
|
|
||||||
if (def->type == VIR_CPU_TYPE_GUEST) {
|
if (def->type == VIR_CPU_TYPE_GUEST) {
|
||||||
g_autofree char *match = virXMLPropString(ctxt->node, "match");
|
g_autofree char *match = virXMLPropString(ctxt->node, "match");
|
||||||
g_autofree char *check = NULL;
|
|
||||||
|
|
||||||
if (match) {
|
if (match) {
|
||||||
def->match = virCPUMatchTypeFromString(match);
|
def->match = virCPUMatchTypeFromString(match);
|
||||||
@ -435,16 +434,9 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((check = virXMLPropString(ctxt->node, "check"))) {
|
if (virXMLPropEnum(ctxt->node, "check", virCPUCheckTypeFromString,
|
||||||
int value = virCPUCheckTypeFromString(check);
|
VIR_XML_PROP_OPTIONAL, &def->check) < 0)
|
||||||
if (value < 0) {
|
return -1;
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("Invalid check attribute for CPU "
|
|
||||||
"specification"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
def->check = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (def->type == VIR_CPU_TYPE_HOST) {
|
if (def->type == VIR_CPU_TYPE_HOST) {
|
||||||
|
Loading…
Reference in New Issue
Block a user