DaanHoogland commented on code in PR #8067:
URL: https://github.com/apache/cloudstack/pull/8067#discussion_r1358108564
##########
plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/driver/LinstorPrimaryDataStoreDriverImpl.java:
##########
@@ -690,24 +770,173 @@ public void revertSnapshot(
}
}
+ private static boolean canCopyTemplateCond(DataObject srcData, DataObject
dstData) {
+ return srcData.getType() == DataObjectType.TEMPLATE &&
dstData.getType() == DataObjectType.TEMPLATE
+ && dstData.getDataStore().getRole() == DataStoreRole.Primary
+ && (srcData.getDataStore().getRole() == DataStoreRole.Image
+ || srcData.getDataStore().getRole() == DataStoreRole.ImageCache);
+ }
+
@Override
- public boolean canCopy(DataObject srcData, DataObject destData)
+ public boolean canCopy(DataObject srcData, DataObject dstData)
{
+ s_logger.debug("LinstorPrimaryDataStoreDriverImpl.canCopy: " +
srcData.getType() + " -> " + dstData.getType());
+
+ if (srcData.getType() == DataObjectType.SNAPSHOT && dstData.getType()
== DataObjectType.SNAPSHOT
+ && (dstData.getDataStore().getRole() == DataStoreRole.Image
+ || dstData.getDataStore().getRole() ==
DataStoreRole.ImageCache)) {
Review Comment:
same condition as below? (same method)
--
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]