CLOUDSTACK-2823: move kernelVersion to global configuration in LibvirtComputingResource.java

This commit is contained in:
Wei Zhou 2013-07-15 10:54:38 +02:00
parent 6e85ae219b
commit 564c30a040
1 changed files with 6 additions and 4 deletions

View File

@ -289,6 +289,7 @@ ServerResource {
private int _migrateSpeed;
private long _hvVersion;
private long _kernelVersion;
private KVMHAMonitor _monitor;
private final String _SSHKEYSPATH = "/root/.ssh";
private final String _SSHPRVKEYPATH = _SSHKEYSPATH + File.separator
@ -846,6 +847,10 @@ ServerResource {
storageProcessor.configure(name, params);
storageHandler = new StorageSubsystemCommandHandlerBase(storageProcessor);
String unameKernelVersion = Script.runSimpleBashScript("uname -r");
String[] kernelVersions = unameKernelVersion.split("[\\.\\-]");
_kernelVersion = Integer.parseInt(kernelVersions[0]) * 1000 * 1000 + Integer.parseInt(kernelVersions[1]) * 1000 + Integer.parseInt(kernelVersions[2]);
return true;
}
@ -3312,10 +3317,7 @@ ServerResource {
// pass cmdline info to system vms
if (vmSpec.getType() != VirtualMachine.Type.User) {
String unameKernelVersion = Script.runSimpleBashScript("uname -r");
String[] kernelVersions = unameKernelVersion.split("[\\.\\-]");
long kernelVersion = Integer.parseInt(kernelVersions[0]) * 1000 * 1000 + Integer.parseInt(kernelVersions[1]) * 1000 + Integer.parseInt(kernelVersions[2]);
if ((kernelVersion < 2006034) && (conn.getVersion() < 1001000)) { // CLOUDSTACK-2823: try passCmdLine some times if kernel < 2.6.34 and qemu < 1.1.0 on hypervisor (for instance, CentOS 6.4)
if ((_kernelVersion < 2006034) && (conn.getVersion() < 1001000)) { // CLOUDSTACK-2823: try passCmdLine some times if kernel < 2.6.34 and qemu < 1.1.0 on hypervisor (for instance, CentOS 6.4)
for (int count = 0; count < 10; count ++) {
passCmdLine(vmName, vmSpec.getBootArgs());
try {