CS-15551 : if 'xen.check.hvm' is false, don't check template hvm in allocator

This commit is contained in:
anthony 2012-07-12 11:16:03 -07:00
parent 9c36ba1ac4
commit 970bdb3972
1 changed files with 6 additions and 0 deletions

View File

@ -77,6 +77,7 @@ public class FirstFitAllocator implements HostAllocator {
@Inject VMInstanceDao _vmInstanceDao = null;
@Inject ResourceManager _resourceMgr;
float _factor = 1;
boolean _checkHvm = true;
protected String _allocationAlgorithm = "random";
@Inject CapacityManager _capacityMgr;
@ -331,6 +332,9 @@ public class FirstFitAllocator implements HostAllocator {
}
protected boolean hostSupportsHVM(HostVO host) {
if ( !_checkHvm ) {
return true;
}
// Determine host capabilities
String caps = host.getCapabilities();
@ -399,6 +403,8 @@ public class FirstFitAllocator implements HostAllocator {
if (allocationAlgorithm != null) {
_allocationAlgorithm = allocationAlgorithm;
}
String value = configs.get("xen.check.hvm");
_checkHvm = value == null ? true : Boolean.parseBoolean(value);
}
return true;
}