On 9/24/21 1:30 AM, Kristina Hanicova wrote:
Signed-off-by: Kristina Hanicova <khanicov(a)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;
}
Honestly, I'm not big fan of return func() == 0 type of statements. But
I think I can live with this.
Michal