{
const testGenericData *data = opaque;
virDomainXMLOption *xmlopt = data->xmlopt;
- int ret = -1;
- char **tpmmodels = NULL;
+ g_auto(GStrv) tpmmodels = NULL;
int ntpmmodels = 0;
g_autoptr(qemuMonitorTest) test = NULL;
" \"passthrough\""
" ]"
"}") < 0)
- goto cleanup;
+ return -1;
if ((ntpmmodels = qemuMonitorGetTPMModels(qemuMonitorTestGetMonitor(test),
&tpmmodels)) < 0)
- goto cleanup;
+ return -1;
if (ntpmmodels != 1) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"ntpmmodels %d is not 1", ntpmmodels);
- goto cleanup;
+ return -1;
}
#define CHECK(i, wantname) \
virReportError(VIR_ERR_INTERNAL_ERROR, \
"name %s is not %s", \
tpmmodels[i], (wantname)); \
- goto cleanup; \
+ return -1; \
} \
} while (0)
#undef CHECK
- ret = 0;
-
- cleanup:
- g_strfreev(tpmmodels);
- return ret;
+ return 0;
}