virsh: fix missing prompt message for 'snapshot-delete' command

Make the command 'virsh snapshot-delete' has the appropriate prompt
message when executing sucessful or failed.
This commit is contained in:
Nan Zhang 2011-07-13 16:36:32 +08:00 committed by Eric Blake
parent 36caaddde6
commit 23cbf1e0d4
2 changed files with 6 additions and 1 deletions

View File

@ -186,6 +186,7 @@ Patches have also been contributed by:
Alex Jia <ajia@redhat.com>
Oskari Saarenmaa <os@ohmu.fi>
Peter Krempa <pkrempa@redhat.com>
Nan Zhang <nzhang@redhat.com>
[....send patches to get your name here....]

View File

@ -11534,8 +11534,12 @@ cmdSnapshotDelete(vshControl *ctl, const vshCmd *cmd)
if (snapshot == NULL)
goto cleanup;
if (virDomainSnapshotDelete(snapshot, flags) < 0)
if (virDomainSnapshotDelete(snapshot, flags) == 0) {
vshPrint(ctl, _("Domain snapshot %s deleted\n"), name);
} else {
vshError(ctl, _("Failed to delete snapshot %s"), name);
goto cleanup;
}
ret = true;