tests: qemu: use g_autoptr where possible

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Ján Tomko
2020-08-03 07:23:46 +02:00
parent 845fee02c1
commit bcbb026993
10 changed files with 27 additions and 56 deletions
+2 -4
View File
@@ -244,7 +244,7 @@ testQemuHotplug(const void *data)
unsigned int device_parse_flags = 0;
virDomainObjPtr vm = NULL;
virDomainDeviceDefPtr dev = NULL;
virCapsPtr caps = NULL;
g_autoptr(virCaps) caps = NULL;
qemuMonitorTestPtr test_mon = NULL;
qemuDomainObjPrivatePtr priv = NULL;
@@ -349,7 +349,6 @@ testQemuHotplug(const void *data)
test->vm = NULL;
}
virDomainDeviceDefFree(dev);
virObjectUnref(caps);
qemuMonitorTestFree(test_mon);
return ((ret < 0 && fail) || (!ret && !fail)) ? 0 : -1;
}
@@ -555,7 +554,7 @@ testQemuHotplugCpuIndividual(const void *opaque)
{
const struct testQemuHotplugCpuParams *params = opaque;
struct testQemuHotplugCpuData *data = NULL;
virBitmapPtr map = NULL;
g_autoptr(virBitmap) map = NULL;
int ret = -1;
int rc;
@@ -584,7 +583,6 @@ testQemuHotplugCpuIndividual(const void *opaque)
ret = testQemuHotplugCpuFinalize(data);
cleanup:
virBitmapFree(map);
testQemuHotplugCpuDataFree(data);
return ret;
}