mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 21:15:20 +00:00
cpu_x86: Use g_auto* in virCPUx86CheckFeature
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e6e54fcebe
commit
3b5f1ca58e
@ -2278,21 +2278,16 @@ static int
|
|||||||
virCPUx86CheckFeature(const virCPUDef *cpu,
|
virCPUx86CheckFeature(const virCPUDef *cpu,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
|
||||||
virCPUx86MapPtr map;
|
virCPUx86MapPtr map;
|
||||||
virCPUx86ModelPtr model = NULL;
|
g_autoptr(virCPUx86Model) model = NULL;
|
||||||
|
|
||||||
if (!(map = virCPUx86GetMap()))
|
if (!(map = virCPUx86GetMap()))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(model = x86ModelFromCPU(cpu, map, -1)))
|
if (!(model = x86ModelFromCPU(cpu, map, -1)))
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
ret = x86FeatureInData(name, &model->data, map);
|
return x86FeatureInData(name, &model->data, map);
|
||||||
|
|
||||||
cleanup:
|
|
||||||
x86ModelFree(model);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user