[PATCH v2 03/10] qemu: rename: return instead of goto if no cleanup required

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

 



Going to cleanup label is mere return -1 thus let's just return
instead of goto to this label.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
---
 src/qemu/qemu_driver.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 22df0f6..621facc 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -19135,20 +19135,20 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
                                                  new_dom_name)) ||
         !(old_dom_cfg_file = virDomainConfigFile(cfg->configDir,
                                                  vm->def->name)))
-        goto cleanup;
+        return -1;
 
     if (vm->autostart) {
         if (!(new_dom_autostart_link = virDomainConfigFile(cfg->autostartDir,
                                                           new_dom_name)) ||
             !(old_dom_autostart_link = virDomainConfigFile(cfg->autostartDir,
                                                           vm->def->name)))
-            goto cleanup;
+            return -1;
 
         if (symlink(new_dom_cfg_file, new_dom_autostart_link) < 0) {
             virReportSystemError(errno,
                                  _("Failed to create symlink '%s to '%s'"),
                                  new_dom_autostart_link, new_dom_cfg_file);
-            goto cleanup;
+            return -1;
         }
     }
 
-- 
1.8.3.1




[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