Signed-off-by: Jiri Denemark <jdene...@redhat.com>
---
 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 b4175a846e..1d7772ee01 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4619,55 +4619,51 @@ qemuDomainDefPostParse(virDomainDefPtr def,
                        void *parseOpaque)
 {
     virQEMUDriverPtr driver = opaque;
-    virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+    VIR_AUTOUNREF(virQEMUDriverConfigPtr) 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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to