@@ -76,6 +76,8 @@ public class AgentShell implements IAgentShell, Daemon {
7676 private String connectedHost ;
7777 private Long preferredHostCheckInterval ;
7878
79+ static final String LIBVIRT_COMPUTING_RESOURCE = "com.cloud.hypervisor.kvm.resource.LibvirtComputingResource" ;
80+
7981 public AgentShell () {
8082 }
8183
@@ -375,7 +377,7 @@ public void init(String[] args) throws ConfigurationException {
375377
376378 loadProperties ();
377379 parseCommand (args );
378- enableSSL ();
380+ enableSSLForKvmAgent ();
379381
380382 if (s_logger .isDebugEnabled ()) {
381383 List <String > properties = Collections .list ((Enumeration <String >)_properties .propertyNames ());
@@ -399,12 +401,17 @@ public void init(String[] args) throws ConfigurationException {
399401 _backoff .configure ("ConstantTimeBackoff" , new HashMap <String , Object >());
400402 }
401403
402- private void enableSSL () {
404+ private void enableSSLForKvmAgent () {
403405 final File agentFile = PropertiesUtil .findConfigFile ("agent.properties" );
404406 if (agentFile == null ) {
405407 s_logger .info ("Failed to find agent.properties file" );
406408 return ;
407409 }
410+ final String resource = getProperty (null , "resource" );
411+ if (!LIBVIRT_COMPUTING_RESOURCE .equalsIgnoreCase (resource )) {
412+ s_logger .info ("This is not a cloudstack kvm agent, ignoring" );
413+ return ;
414+ }
408415 String keystorePass = getProperty (null , "keystore.passphrase" );
409416 if (StringUtils .isBlank (keystorePass )) {
410417 s_logger .info ("Failed to find passphrase for keystore: " + KeyStoreUtils .KS_FILENAME );
0 commit comments