c401cc
From 2a7fc8004f198dcf8afe255b50b9c74646499000 Mon Sep 17 00:00:00 2001
c401cc
Message-Id: <2a7fc8004f198dcf8afe255b50b9c74646499000@dist-git>
c401cc
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
c401cc
Date: Fri, 21 Feb 2014 12:07:03 +0100
c401cc
Subject: [PATCH] Ignore additional fields in iscsiadm output
c401cc
c401cc
There has been a new field introduced in iscsiadm --mode session
c401cc
output [1], but our regex only expects four fields. This breaks
c401cc
startup of iscsi pools:
c401cc
error: Failed to start pool iscsi
c401cc
error: internal error: cannot find session
c401cc
c401cc
Fix this by ignoring anything after the fourth field.
c401cc
c401cc
https://bugzilla.redhat.com/show_bug.cgi?id=1067173
c401cc
c401cc
[1] https://github.com/mikechristie/open-iscsi/commit/181af9a
c401cc
c401cc
(cherry picked from commit 57e17a74b76fd8f93012d6d0407106e9a2d5c5e3)
c401cc
c401cc
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c401cc
---
c401cc
 src/storage/storage_backend_iscsi.c | 2 +-
c401cc
 1 file changed, 1 insertion(+), 1 deletion(-)
c401cc
c401cc
diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
c401cc
index 556c2cc..1149e43 100644
c401cc
--- a/src/storage/storage_backend_iscsi.c
c401cc
+++ b/src/storage/storage_backend_iscsi.c
c401cc
@@ -102,7 +102,7 @@ virStorageBackendISCSISession(virStoragePoolObjPtr pool,
c401cc
      * Pull out 2nd and 4th fields
c401cc
      */
c401cc
     const char *regexes[] = {
c401cc
-        "^tcp:\\s+\\[(\\S+)\\]\\s+\\S+\\s+(\\S+)\\s*$"
c401cc
+        "^tcp:\\s+\\[(\\S+)\\]\\s+\\S+\\s+(\\S+).*$"
c401cc
     };
c401cc
     int vars[] = {
c401cc
         2,
c401cc
-- 
c401cc
1.9.0
c401cc