qemu: rename: return instead of goto if no cleanup required

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@virtuozzo.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Nikolay Shirokovskiy 2020-11-03 10:55:19 +03:00
parent 9a5ac61c4e
commit a6c3b5e6a1

View File

@ -19130,20 +19130,20 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
new_dom_name)) || new_dom_name)) ||
!(old_dom_cfg_file = virDomainConfigFile(cfg->configDir, !(old_dom_cfg_file = virDomainConfigFile(cfg->configDir,
vm->def->name))) vm->def->name)))
goto cleanup; return -1;
if (vm->autostart) { if (vm->autostart) {
if (!(new_dom_autostart_link = virDomainConfigFile(cfg->autostartDir, if (!(new_dom_autostart_link = virDomainConfigFile(cfg->autostartDir,
new_dom_name)) || new_dom_name)) ||
!(old_dom_autostart_link = virDomainConfigFile(cfg->autostartDir, !(old_dom_autostart_link = virDomainConfigFile(cfg->autostartDir,
vm->def->name))) vm->def->name)))
goto cleanup; return -1;
if (symlink(new_dom_cfg_file, new_dom_autostart_link) < 0) { if (symlink(new_dom_cfg_file, new_dom_autostart_link) < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to create symlink '%s to '%s'"), _("Failed to create symlink '%s to '%s'"),
new_dom_autostart_link, new_dom_cfg_file); new_dom_autostart_link, new_dom_cfg_file);
goto cleanup; return -1;
} }
} }