From d2d9b3c72f625f1efcbe6f20032e6002da3004ae Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Thu, 20 Aug 2020 00:14:13 +0530 Subject: [PATCH] Fix proper error message on revert volume snapshot operation in case of any hypervisor other than KVM --- .../java/com/cloud/storage/snapshot/SnapshotManagerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java index 35ec665b97d..1eb72e2a24c 100755 --- a/server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -311,7 +311,8 @@ public class SnapshotManagerImpl extends MutualExclusiveIdsManagerBase implement if (snapshotStrategy == null) { s_logger.error("Unable to find snaphot strategy to handle snapshot with id '" + snapshotId + "'"); - return null; + String errorMsg = String.format("Revert snapshot command failed for snapshot with id %d, because this command is supported only for KVM hypervisor", snapshotId); + throw new CloudRuntimeException(errorMsg); } boolean result = snapshotStrategy.revertSnapshot(snapshotInfo);