Re: [PATCH v1 10/21] qemu: remove unneeded cleanup labels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 11/12/19 1:40 PM, Ján Tomko wrote:
On Mon, Oct 21, 2019 at 03:19:00PM -0300, Daniel Henrique Barboza wrote:
Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>
---
src/qemu/qemu_cgroup.c         |  15 ++--
src/qemu/qemu_domain.c         |  92 ++++++++--------------
src/qemu/qemu_domain_address.c |  31 +++-----
src/qemu/qemu_driver.c         | 140 ++++++++++++---------------------
src/qemu/qemu_hotplug.c        |  45 +++++------
src/qemu/qemu_interface.c      |  26 +++---
src/qemu/qemu_migration.c      |  38 +++------
src/qemu/qemu_process.c        |  77 ++++++------------
src/qemu/qemu_tpm.c            |  20 ++---
9 files changed, 172 insertions(+), 312 deletions(-)

@@ -3739,19 +3735,18 @@ qemuDumpToFd(virQEMUDriverPtr driver,
                           dumpformat);
            ret = -1;
            ignore_value(qemuDomainObjExitMonitor(driver, vm));
-            goto cleanup;
+            return ret;

ret is set to -1 just a few lines above, so returning -1 here is fine.

        }
    }

    ret = qemuMonitorDumpToFd(priv->mon, fd, dumpformat, detach);

    if ((qemuDomainObjExitMonitor(driver, vm) < 0) || ret < 0)
-        goto cleanup;
+        return ret;

qemuMonitorDumpToFd returns either 0 or -1 so returning -1 here is also
fine.


    if (detach)
        ret = qemuDumpWaitForCompletion(vm);

- cleanup:
    return ret;
}

@@ -17450,18 +17423,17 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
        ret = qemuMonitorDrivePivot(priv->mon, job->name);
    if (qemuDomainObjExitMonitor(driver, vm) < 0) {
        ret = -1;
-        goto cleanup;
+        return ret;

return -1;

    }

    /* The pivot failed. The block job in QEMU remains in the synchronised state */
    if (ret < 0)
-        goto cleanup;
+        return ret;

return -1;


    if (disk && disk->mirror)
        disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_PIVOT;
    job->state = QEMU_BLOCKJOB_STATE_PIVOTING;

- cleanup:
    return ret;
}

@@ -4037,7 +4031,7 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver,
            virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                           _("cannot change the type of listen address "
                             "on '%s' graphics"), type);
-            goto cleanup;
+            return ret;

No need to use ret in this function


Thanks for the reviews. Just saw you pushed almost all of the series, dropping the patch you mentioned holding back 3 patches pending review. I'll send a v2 with these 3 remaining patches.



DHB




        }

        switch (newlisten->type) {

Jano


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





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux