From ab01692ea6b778b20b194c134a1a6f91f7f813c6 Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Thu, 7 Jul 2016 12:00:56 +0200 Subject: [PATCH] iscsi-ls: strip portal group tag in url output we do not use it in libiscsi anyway, but e.g. Qemu does not support in in the URL. Signed-off-by: Peter Lieven --- utils/iscsi-ls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/iscsi-ls.c b/utils/iscsi-ls.c index 0a06224..fff014b 100644 --- a/utils/iscsi-ls.c +++ b/utils/iscsi-ls.c @@ -263,6 +263,10 @@ void discovery_cb(struct iscsi_context *iscsi, int status, void *command_data, v while (portal != NULL) { if (useurls == 1 && showluns == 0) { + char *str = strrchr(portal->portal, ','); + if (str != NULL) { + str[0] = 0; + } printf("iscsi://%s/%s/0\n", portal->portal, addr->target_name); } else { printf("Target:%s Portal:%s\n", addr->target_name, portal->portal);