ravening commented on a change in pull request #5862:
URL: https://github.com/apache/cloudstack/pull/5862#discussion_r836342469



##########
File path: 
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/KVMHAVMActivityChecker.java
##########
@@ -27,36 +28,50 @@
     private static final Logger LOG = 
Logger.getLogger(KVMHAVMActivityChecker.class);
 
     final private NfsStoragePool nfsStoragePool;
+    final private RbdStoragePool rbdStoragePool;
     final private String hostIP;
     final private String volumeUuidList;
     final private String vmActivityCheckPath;
     final private Duration activityScriptTimeout = 
Duration.standardSeconds(3600L);
     final private long suspectTimeInSeconds;
+    final private StoragePoolType poolType;
 
-    public KVMHAVMActivityChecker(final NfsStoragePool pool, final String 
host, final String volumeUUIDListString, String vmActivityCheckPath, final long 
suspectTime) {
+    public KVMHAVMActivityChecker(final NfsStoragePool pool, final 
RbdStoragePool rbdpool, final String host, final String volumeUUIDListString, 
String vmActivityCheckPath, final long suspectTime, StoragePoolType poolType) {
         this.nfsStoragePool = pool;
+        this.rbdStoragePool = rbdpool;
         this.hostIP = host;
         this.volumeUuidList = volumeUUIDListString;
         this.vmActivityCheckPath = vmActivityCheckPath;
         this.suspectTimeInSeconds = suspectTime;
+        this.poolType = poolType;
     }
 
     @Override
     public Boolean checkingHeartBeat() {
         Script cmd = new Script(vmActivityCheckPath, 
activityScriptTimeout.getStandardSeconds(), LOG);
-        cmd.add("-i", nfsStoragePool._poolIp);
-        cmd.add("-p", nfsStoragePool._poolMountSourcePath);
-        cmd.add("-m", nfsStoragePool._mountDestPath);
+        String poolIp = "";
+        if (poolType == StoragePoolType.NetworkFilesystem) {

Review comment:
       Rather than adding `if/else` extract them according the pool type. In 
future, if we support more pool type, they can goto their own functions else 
code will look messy




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to