Re: [PATCH] Ignore additional fields in iscsiadm output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 21, 2014 at 11:01:17AM +0100, Ján Tomko wrote:
> There has been a new field introduced in iscsiadm --mode session
> output [1], but our regex only expects four fields. This breaks
> startup of iscsi pools:
> error: Failed to start pool iscsi
> error: internal error: cannot find session
> 
> Fix this by ignoring anything after the fourth field.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1067173
> 
> [1] https://github.com/mikechristie/open-iscsi/commit/181af9a
> ---
>  src/storage/storage_backend_iscsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
> index 556c2cc..1149e43 100644
> --- a/src/storage/storage_backend_iscsi.c
> +++ b/src/storage/storage_backend_iscsi.c
> @@ -102,7 +102,7 @@ virStorageBackendISCSISession(virStoragePoolObjPtr pool,
>       * Pull out 2nd and 4th fields
>       */
>      const char *regexes[] = {
> -        "^tcp:\\s+\\[(\\S+)\\]\\s+\\S+\\s+(\\S+)\\s*$"
> +        "^tcp:\\s+\\[(\\S+)\\]\\s+\\S+\\s+(\\S+).*$"
>      };
>      int vars[] = {
>          2,

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]