File tree Expand file tree Collapse file tree
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ public class IscsiStorageCleanupMonitor implements Runnable{
3939 private static final String KEYWORD_ISCSI = "iscsi" ;
4040 private static final String KEYWORD_IQN = "iqn" ;
4141 private static final String KEYWORD_PART = "part" ;
42+ private static final String REGEX_PART = "\\ S+part\\ d+$" ;
4243
4344 private IscsiAdmStorageAdaptor iscsiStorageAdaptor ;
4445
@@ -115,7 +116,7 @@ private void updateDiskStatusMapWithInactiveIscsiSessions(Connect conn){
115116
116117 //check the volume map. If an entry exists change the status to True
117118 for (final LibvirtVMDef .DiskDef disk : disks ) {
118- if (diskStatusMap .containsKey (disk .getDiskPath ())&&!disk .getDiskPath ().contains ( KEYWORD_PART )) {
119+ if (diskStatusMap .containsKey (disk .getDiskPath ())&&!disk .getDiskPath ().matches ( REGEX_PART )) {
119120 diskStatusMap .put (disk .getDiskPath (), true );
120121 s_logger .debug ("active disk found by cleanup thread" + disk .getDiskPath ());
121122 }
You can’t perform that action at this time.
0 commit comments