[PATCH v2 2/2] virsh: domain: remove unnecessary variable and label in cmdMigrateSetMaxDowntime()

Kristina Hanicova khanicov at redhat.com
Thu Sep 23 23:30:49 UTC 2021


Signed-off-by: Kristina Hanicova <khanicov at redhat.com>
---
 tools/virsh-domain.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 2730acfba5..cfa0016296 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -11006,25 +11006,19 @@ cmdMigrateSetMaxDowntime(vshControl *ctl, const vshCmd *cmd)
 {
     g_autoptr(virshDomain) dom = NULL;
     unsigned long long downtime = 0;
-    bool ret = false;
 
     if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
         return false;
 
     if (vshCommandOptULongLong(ctl, cmd, "downtime", &downtime) < 0)
-        goto done;
+        return false;
+
     if (downtime < 1) {
         vshError(ctl, "%s", _("migrate: Invalid downtime"));
-        goto done;
+        return false;
     }
 
-    if (virDomainMigrateSetMaxDowntime(dom, downtime, 0) < 0)
-        goto done;
-
-    ret = true;
-
- done:
-    return ret;
+    return virDomainMigrateSetMaxDowntime(dom, downtime, 0) == 0;
 }
 
 
-- 
2.31.1




More information about the libvir-list mailing list