mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	Cherry-picked from 44f80648a9ea818e34997416aabbcd95cb03f847 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
		
							parent
							
								
									86cad79c15
								
							
						
					
					
						commit
						6f931dbd00
					
				| @ -93,7 +93,6 @@ import com.cloud.utils.nio.Link; | |||||||
| import com.cloud.utils.nio.NioClient; | import com.cloud.utils.nio.NioClient; | ||||||
| import com.cloud.utils.nio.NioConnection; | import com.cloud.utils.nio.NioConnection; | ||||||
| import com.cloud.utils.nio.Task; | import com.cloud.utils.nio.Task; | ||||||
| import com.cloud.utils.script.OutputInterpreter; |  | ||||||
| import com.cloud.utils.script.Script; | import com.cloud.utils.script.Script; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
| @ -598,9 +597,9 @@ public class Agent implements HandlerFactory, IAgentControl, AgentStatusUpdater | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     protected String getAgentArch() { |     protected String getAgentArch() { | ||||||
|         final Script command = new Script("/usr/bin/arch", 500, logger); |         String arch = Script.runSimpleBashScript(Script.getExecutableAbsolutePath("arch"), 2000); | ||||||
|         final OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser(); |         logger.debug("Arch for agent: {} found: {}", _name, arch); | ||||||
|         return command.execute(parser); |         return arch; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|  | |||||||
| @ -58,7 +58,7 @@ public class KVMHostInfo { | |||||||
|     private long reservedMemory; |     private long reservedMemory; | ||||||
|     private long overCommitMemory; |     private long overCommitMemory; | ||||||
|     private List<String> capabilities = new ArrayList<>(); |     private List<String> capabilities = new ArrayList<>(); | ||||||
|     private static String cpuArchCommand = "/usr/bin/arch"; |     private static String cpuArchRetrieveExecutable = "arch"; | ||||||
|     private static List<String> cpuInfoFreqFileNames = List.of("/sys/devices/system/cpu/cpu0/cpufreq/base_frequency","/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"); |     private static List<String> cpuInfoFreqFileNames = List.of("/sys/devices/system/cpu/cpu0/cpufreq/base_frequency","/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"); | ||||||
| 
 | 
 | ||||||
|     public KVMHostInfo(long reservedMemory, long overCommitMemory, long manualSpeed, int reservedCpus) { |     public KVMHostInfo(long reservedMemory, long overCommitMemory, long manualSpeed, int reservedCpus) { | ||||||
| @ -248,6 +248,6 @@ public class KVMHostInfo { | |||||||
| 
 | 
 | ||||||
|     private String getCPUArchFromCommand() { |     private String getCPUArchFromCommand() { | ||||||
|         LOGGER.info("Fetching host CPU arch"); |         LOGGER.info("Fetching host CPU arch"); | ||||||
|         return Script.runSimpleBashScript(cpuArchCommand); |         return Script.runSimpleBashScript(Script.getExecutableAbsolutePath(cpuArchRetrieveExecutable)); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user