On a Tuesday in 2022, Haruka Ohata wrote:
When running virsh snapshot-* command, such as
snapshot-create-as / snapshot-delete, it prints a result message.
On the other hand virsh snapshot-revert command doesn't print a result
message.
So, This patch fixes to add message when running virsh snapshot-revert
command.
---
# virsh snapshot-create-as vm1 test1
Domain snapshot test01 created
# virsh snapshot-revert vm1 test1
# virsh snapshot-delete vm1 test1
Domain snapshot test01 deleted
#
---
Signed-off-by: Haruka Ohata <ohata.haruka(a)fujitsu.com>
---
tests/virsh-snapshot | 3 +++
tools/virsh-snapshot.c | 1 +
2 files changed, 4 insertions(+)
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c
index 8fa64ba903..6a6c92d0a3 100644
--- a/tools/virsh-snapshot.c
+++ b/tools/virsh-snapshot.c
@@ -1783,6 +1783,7 @@ cmdDomainSnapshotRevert(vshControl *ctl, const vshCmd *cmd)
result = virDomainRevertToSnapshot(snapshot, flags);
}
+ vshPrintExtra(ctl, _("Domain snapshot %s reverted\n"), name);
return result >= 0;
This would print the message regardless of what the
virDomainRevertToSnapshot API would return.
Looks like we need to return the value the way it was done before
commit 19b77df5cc0b7577cb5b045c76f8b79221f32ac0
Jano
}
--
2.38.1