DaanHoogland commented on a change in pull request #5297:
URL: https://github.com/apache/cloudstack/pull/5297#discussion_r697235222
##########
File path:
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRevertSnapshotCommandWrapper.java
##########
@@ -42,37 +49,41 @@
import com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager;
import com.cloud.resource.CommandWrapper;
import com.cloud.resource.ResourceWrapper;
+import com.cloud.storage.DataStoreRole;
import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.utils.Pair;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.script.Script;
@ResourceWrapper(handles = RevertSnapshotCommand.class)
-public final class LibvirtRevertSnapshotCommandWrapper extends
CommandWrapper<RevertSnapshotCommand, Answer, LibvirtComputingResource> {
+public class LibvirtRevertSnapshotCommandWrapper extends
CommandWrapper<RevertSnapshotCommand, Answer, LibvirtComputingResource> {
private static final Logger s_logger =
Logger.getLogger(LibvirtRevertSnapshotCommandWrapper.class);
private static final String MON_HOST = "mon_host";
private static final String KEY = "key";
private static final String CLIENT_MOUNT_TIMEOUT = "client_mount_timeout";
private static final String RADOS_CONNECTION_TIMEOUT = "30";
+ protected Set<StoragePoolType> storagePoolTypesThatSupportRevertSnapshot =
new HashSet<>(Arrays.asList(StoragePoolType.RBD, StoragePoolType.Filesystem,
+ StoragePoolType.NetworkFilesystem,
StoragePoolType.SharedMountPoint));
+
@Override
public Answer execute(final RevertSnapshotCommand command, final
LibvirtComputingResource libvirtComputingResource) {
+ SnapshotObjectTO snapshotOnPrimaryStorage =
command.getDataOnPrimaryStorage();
SnapshotObjectTO snapshot = command.getData();
VolumeObjectTO volume = snapshot.getVolume();
PrimaryDataStoreTO primaryStore =
(PrimaryDataStoreTO)volume.getDataStore();
DataStoreTO snapshotImageStore = snapshot.getDataStore();
- if (!(snapshotImageStore instanceof NfsTO) &&
primaryStore.getPoolType() != StoragePoolType.RBD) {
+ if (!(snapshotImageStore instanceof NfsTO) &&
!storagePoolTypesThatSupportRevertSnapshot.contains(primaryStore.getPoolType()))
{
Review comment:
btw i realise the old code used it as well, but i have the impression it
will be used more intensively now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]