Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
---
Notes:
Version 2:
- no change
Version 3:
- g_autoptr
src/qemu/qemu_domain.c | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 8627238c6a..7e470c602a 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4610,55 +4610,51 @@ qemuDomainDefPostParse(virDomainDefPtr def,
void *parseOpaque)
{
virQEMUDriverPtr driver = opaque;
- virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+ g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
/* Note that qemuCaps may be NULL when this function is called. This
* function shall not fail in that case. It will be re-run on VM startup
* with the capabilities populated. */
virQEMUCapsPtr qemuCaps = parseOpaque;
- int ret = -1;
if (def->os.bootloader || def->os.bootloaderArgs) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("bootloader is not supported by QEMU"));
- goto cleanup;
+ return -1;
}
if (!def->os.machine) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing machine type"));
- goto cleanup;
+ return -1;
}
if (qemuDomainNVRAMPathGenerate(cfg, def) < 0)
- goto cleanup;
+ return -1;
if (qemuDomainDefAddDefaultDevices(def, qemuCaps) < 0)
- goto cleanup;
+ return -1;
if (qemuCanonicalizeMachine(def, qemuCaps) < 0)
- goto cleanup;
+ return -1;
qemuDomainDefEnableDefaultFeatures(def, qemuCaps);
if (qemuDomainRecheckInternalPaths(def, cfg, parseFlags) < 0)
- goto cleanup;
+ return -1;
if (qemuSecurityVerify(driver->securityManager, def) < 0)
- goto cleanup;
+ return -1;
if (qemuDomainDefVcpusPostParse(def) < 0)
- goto cleanup;
+ return -1;
if (qemuDomainDefCPUPostParse(def) < 0)
- goto cleanup;
+ return -1;
if (qemuDomainDefTsegPostParse(def, qemuCaps) < 0)
- goto cleanup;
+ return -1;
- ret = 0;
- cleanup:
- virObjectUnref(cfg);
- return ret;
+ return 0;
}
--
2.23.0