mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-18 05:31:14 +00:00
cpu: Use g_auto* in virCPUCompareXML
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e8d40cc3be
commit
ca1c9716cc
@ -111,21 +111,15 @@ virCPUCompareXML(virArch arch,
|
|||||||
const char *xml,
|
const char *xml,
|
||||||
bool failIncompatible)
|
bool failIncompatible)
|
||||||
{
|
{
|
||||||
virCPUDefPtr cpu = NULL;
|
g_autoptr(virCPUDef) cpu = NULL;
|
||||||
virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR;
|
|
||||||
|
|
||||||
VIR_DEBUG("arch=%s, host=%p, xml=%s",
|
VIR_DEBUG("arch=%s, host=%p, xml=%s",
|
||||||
virArchToString(arch), host, NULLSTR(xml));
|
virArchToString(arch), host, NULLSTR(xml));
|
||||||
|
|
||||||
if (virCPUDefParseXMLString(xml, VIR_CPU_TYPE_AUTO, &cpu) < 0)
|
if (virCPUDefParseXMLString(xml, VIR_CPU_TYPE_AUTO, &cpu) < 0)
|
||||||
goto cleanup;
|
return VIR_CPU_COMPARE_ERROR;
|
||||||
|
|
||||||
ret = virCPUCompare(arch, host, cpu, failIncompatible);
|
return virCPUCompare(arch, host, cpu, failIncompatible);
|
||||||
|
|
||||||
cleanup:
|
|
||||||
virCPUDefFree(cpu);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user