mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
tests: cputest: use g_auto for virQEMUCaps
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
e2b5fc9a8b
commit
a32c2b2360
@ -514,7 +514,7 @@ static int
|
||||
cpuTestGetCPUModels(const struct data *data,
|
||||
virDomainCapsCPUModels **models)
|
||||
{
|
||||
virQEMUCaps *qemuCaps;
|
||||
g_autoptr(virQEMUCaps) qemuCaps = NULL;
|
||||
|
||||
*models = NULL;
|
||||
|
||||
@ -527,8 +527,6 @@ cpuTestGetCPUModels(const struct data *data,
|
||||
|
||||
*models = virQEMUCapsGetCPUModels(qemuCaps, VIR_DOMAIN_VIRT_KVM, NULL, NULL);
|
||||
|
||||
virObjectUnref(qemuCaps);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -861,7 +859,7 @@ static int
|
||||
cpuTestJSONCPUID(const void *arg)
|
||||
{
|
||||
const struct data *data = arg;
|
||||
virQEMUCaps *qemuCaps = NULL;
|
||||
g_autoptr(virQEMUCaps) qemuCaps = NULL;
|
||||
virCPUDef *cpu = NULL;
|
||||
char *result = NULL;
|
||||
int ret = -1;
|
||||
@ -883,7 +881,6 @@ cpuTestJSONCPUID(const void *arg)
|
||||
ret = cpuTestCompareXML(data->arch, cpu, result);
|
||||
|
||||
cleanup:
|
||||
virObjectUnref(qemuCaps);
|
||||
virCPUDefFree(cpu);
|
||||
VIR_FREE(result);
|
||||
return ret;
|
||||
@ -894,7 +891,7 @@ static int
|
||||
cpuTestJSONSignature(const void *arg)
|
||||
{
|
||||
const struct data *data = arg;
|
||||
virQEMUCaps *qemuCaps = NULL;
|
||||
g_autoptr(virQEMUCaps) qemuCaps = NULL;
|
||||
virCPUData *hostData = NULL;
|
||||
qemuMonitorCPUModelInfo *modelInfo;
|
||||
int ret = -1;
|
||||
@ -909,7 +906,6 @@ cpuTestJSONSignature(const void *arg)
|
||||
ret = cpuTestCompareSignature(data, hostData);
|
||||
|
||||
cleanup:
|
||||
virObjectUnref(qemuCaps);
|
||||
virCPUDataFree(hostData);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user