CLOUDSTACK-6893: fix enum ValueOf issue which causes systemvm fail to start

(cherry picked from commit 63ff5a7cbc3341809884e47796476d47ace03961)
(cherry picked from commit d0e0edca111feb71e7cd8267d9c28820d85b12f9)
This commit is contained in:
Wei Zhou 2014-06-11 13:46:12 +02:00 committed by Wei Zhou
parent a2acae13e3
commit daa57f67d6

View File

@ -3999,7 +3999,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
if ((volumeObjectTO.getIopsWriteRate() != null) && (volumeObjectTO.getIopsWriteRate() > 0))
disk.setIopsWriteRate(volumeObjectTO.getIopsWriteRate());
if (volumeObjectTO.getCacheMode() != null)
disk.setCacheMode(DiskDef.diskCacheMode.valueOf(volumeObjectTO.getCacheMode().toString()));
disk.setCacheMode(DiskDef.diskCacheMode.valueOf(volumeObjectTO.getCacheMode().toString().toUpperCase()));
}
vm.getDevices().addDevice(disk);
}
@ -4162,7 +4162,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
diskdef.setIopsWriteRate(iopsWriteRate);
if (cacheMode != null) {
diskdef.setCacheMode(DiskDef.diskCacheMode.valueOf(cacheMode));
diskdef.setCacheMode(DiskDef.diskCacheMode.valueOf(cacheMode.toUpperCase()));
}
}