}
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
- goto stop;
+ goto cleanup;
+
+ VIR_DEBUG("Determining emulator version");
+ virObjectUnref(priv->qemuCaps);
+ if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(driver->qemuCapsCache,
+ vm->def->emulator,
+ vm->def->os.machine)))
+ goto cleanup;
/* Some things, paths, ... are generated here and we want them to persist.
* Fill them in prior to setting the domain def as transient. */
VIR_HOOK_SUBOP_BEGIN) < 0)
goto stop;
- VIR_DEBUG("Determining emulator version");
- virObjectUnref(priv->qemuCaps);
- if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(driver->qemuCapsCache,
- vm->def->emulator,
- vm->def->os.machine)))
- goto stop;
-
ret = 0;
cleanup: