mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
virsh: Make code flow in cmdManagedSaveRemove more straightforward
By doing so we can get rid of the code which violates our coding style guidelines. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
4d31c02f05
commit
88810c5267
@ -4788,18 +4788,19 @@ cmdManagedSaveRemove(vshControl *ctl, const vshCmd *cmd)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hassave) {
|
if (hassave == 0) {
|
||||||
if (virDomainManagedSaveRemove(dom, 0) < 0) {
|
|
||||||
vshError(ctl, _("Failed to remove managed save image for domain '%s'"),
|
|
||||||
name);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
vshPrintExtra(ctl, _("Removed managedsave image for domain '%s'"), name);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
vshPrintExtra(ctl, _("Domain '%s' has no manage save image; removal skipped"),
|
vshPrintExtra(ctl, _("Domain '%s' has no manage save image; removal skipped"),
|
||||||
name);
|
name);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (virDomainManagedSaveRemove(dom, 0) < 0) {
|
||||||
|
vshError(ctl, _("Failed to remove managed save image for domain '%s'"),
|
||||||
|
name);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
vshPrintExtra(ctl, _("Removed managedsave image for domain '%s'"), name);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user