}
protected boolean needCacheStorage(DataObject srcData, DataObject destData) {
DataTO srcTO = srcData.getTO();
DataTO destTO = destData.getTO();
DataStoreTO srcStoreTO = srcTO.getDataStore();
DataStoreTO destStoreTO = destTO.getDataStore();
if (srcStoreTO instanceof NfsTO || srcStoreTO.getRole() == DataStoreRole.ImageCache) {
return false;
}
if (destStoreTO instanceof NfsTO || destStoreTO.getRole() == DataStoreRole.ImageCache) {
return false;
}
if (srcData.getType() == DataObjectType.TEMPLATE) {
TemplateInfo template = (TemplateInfo)srcData;
if (template.getHypervisorType() == HypervisorType.Hyperv) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("needCacheStorage false due to src TemplateInfo, which is DataObjectType.TEMPLATE of HypervisorType.Hyperv");
}
return false;
}
}
if (s_logger.isDebugEnabled()) {
s_logger.debug("needCacheStorage true, dest at " +
destTO.getPath() + " dest role " + destStoreTO.getRole().toString() +
srcTO.getPath() + " src role " + srcStoreTO.getRole().toString() );
}
return true;
}