CLOUDSTACK-8964: Ovm3HypervisorGuru handle only srcData with HypervisorType is Ovm3

This commit is contained in:
Wei Zhou 2015-12-04 18:26:12 +01:00
parent 69e031d9be
commit a90b953dbc

View File

@ -96,18 +96,16 @@ public class Ovm3HypervisorGuru extends HypervisorGuruBase implements Hypervisor
DataTO srcData = cpyCommand.getSrcTO();
DataTO destData = cpyCommand.getDestTO();
if (srcData.getObjectType() == DataObjectType.SNAPSHOT && destData.getObjectType() == DataObjectType.TEMPLATE) {
if (HypervisorType.Ovm3.equals(srcData.getHypervisorType()) && srcData.getObjectType() == DataObjectType.SNAPSHOT && destData.getObjectType() == DataObjectType.TEMPLATE) {
LOGGER.debug("Snapshot to Template: " + cmd);
DataStoreTO srcStore = srcData.getDataStore();
DataStoreTO destStore = destData.getDataStore();
if (srcStore instanceof NfsTO && destStore instanceof NfsTO) {
HostVO host = hostDao.findById(hostId);
EndPoint ep = endPointSelector.selectHypervisorHost(new ZoneScope(host.getDataCenterId()));
host = hostDao.findById(ep.getId());
hostDao.loadDetails(host);
// String snapshotHotFixVersion = host.getDetail(XenserverConfigs.XS620HotFix);
// if (snapshotHotFixVersion != null && snapshotHotFixVersion.equalsIgnoreCase(XenserverConfigs.XSHotFix62ESP1004)) {
return new Pair<Boolean, Long>(Boolean.TRUE, Long.valueOf(ep.getId()));
if (ep != null) {
return new Pair<Boolean, Long>(Boolean.TRUE, Long.valueOf(ep.getId()));
}
}
}
}