{
int ret = 0;
virQEMUDriverPtr driver = opaque;
- virQEMUCapsPtr qemuCaps = NULL;
- virDomainCapsPtr domCaps = NULL;
+ g_autoptr(virQEMUCaps) qemuCaps = NULL;
+ g_autoptr(virDomainCaps) domCaps = NULL;
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache,
def->emulator)))
def->os.machine,
def->os.arch,
def->virtType)))
- goto cleanup;
+ return -1;
if ((ret = qemuDomainDeviceDefValidateAddress(dev, qemuCaps)) < 0)
- goto cleanup;
+ return ret;
if ((ret = virDomainCapsDeviceDefValidate(domCaps, dev, def)) < 0)
- goto cleanup;
+ return ret;
switch ((virDomainDeviceType)dev->type) {
case VIR_DOMAIN_DEVICE_NET:
break;
}
- cleanup:
- virObjectUnref(qemuCaps);
- virObjectUnref(domCaps);
return ret;
}