virsh: domain: remove unnecessary variable and label in cmdMigrateSetMaxDowntime()

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Kristina Hanicova 2021-09-24 01:30:49 +02:00 committed by Michal Privoznik
parent 0987edbedf
commit bc7b8a34fa

View File

@ -10988,25 +10988,19 @@ cmdMigrateSetMaxDowntime(vshControl *ctl, const vshCmd *cmd)
{ {
g_autoptr(virshDomain) dom = NULL; g_autoptr(virshDomain) dom = NULL;
unsigned long long downtime = 0; unsigned long long downtime = 0;
bool ret = false;
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL))) if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false; return false;
if (vshCommandOptULongLong(ctl, cmd, "downtime", &downtime) < 0) if (vshCommandOptULongLong(ctl, cmd, "downtime", &downtime) < 0)
goto done; return false;
if (downtime < 1) { if (downtime < 1) {
vshError(ctl, "%s", _("migrate: Invalid downtime")); vshError(ctl, "%s", _("migrate: Invalid downtime"));
goto done; return false;
} }
if (virDomainMigrateSetMaxDowntime(dom, downtime, 0) < 0) return virDomainMigrateSetMaxDowntime(dom, downtime, 0) == 0;
goto done;
ret = true;
done:
return ret;
} }