Skip to content

Commit 777528a

Browse files
Gupta, SuryaGupta, Surya
authored andcommitted
[CSTACKEX-233] Added comment for \n split
1 parent f87fdc0 commit 777528a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/IscsiAdmStorageAdaptor.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ private boolean isIscsiSessionActive(String iqn, String host, int port) {
236236
if (StringUtils.isBlank(sessions)) {
237237
return false;
238238
}
239+
// AllLinesParser uses BufferedReader.readLine() (strips \n, \r\n, and \r) and then
240+
// appends "\n" after each session. split("\n") depends on that separator to walk
241+
// one session per line when multiple sessions are listed.
239242
for (String line : sessions.split("\n")) {
240243
if (line.contains(iqn) && line.contains(host)) {
241244
return true;

0 commit comments

Comments
 (0)