[libvirt PATCH 2/3] openvzDomainMigratePrepare3Params: remove else after goto

Ján Tomko jtomko at redhat.com
Thu Nov 19 10:33:28 UTC 2020


We jump to the error label if the 'if' condition is true.
Remove the explicit else to make it more obvious that 'hostname'
is filled on both branches of 'if (!uri_in)'.

Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 src/openvz/openvz_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 4fa7511f88..c6b7e21e7a 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -2130,9 +2130,9 @@ openvzDomainMigratePrepare3Params(virConnectPtr dconn,
                            _("missing host in migration URI: %s"),
                            uri_in);
             goto error;
-        } else {
-            hostname = uri->server;
         }
+
+        hostname = uri->server;
     }
 
     *uri_out = g_strdup_printf("ssh://%s", hostname);
-- 
2.26.2




More information about the libvir-list mailing list