all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage] iscsi: add hostname support in portal addresses
@ 2025-06-26  2:29 Stelios Vailakakis
  2025-08-04 18:45 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Stelios Vailakakis @ 2025-06-26  2:29 UTC (permalink / raw)
  To: pve-devel

Currently, the iSCSI plugin regex patterns only match IPv4 and IPv6
addresses, causing session parsing to fail when portals use hostnames
(like nas.example.com:3260).

This patch updates ISCSI_TARGET_RE and session parsing regex to accept
any non-whitespace characters before the port, allowing hostname-based
portals to work correctly.

Tested with IP and hostname-based portals on Proxmox VE 8.2, 8.3, and 8.4.1

Signed-off-by: Stelios Vailakakis <stelios@libvirt.dev>
---
 src/PVE/Storage/ISCSIPlugin.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/Storage/ISCSIPlugin.pm b/src/PVE/Storage/ISCSIPlugin.pm
index 7691ec6..33b3d19 100644
--- a/src/PVE/Storage/ISCSIPlugin.pm
+++ b/src/PVE/Storage/ISCSIPlugin.pm
@@ -33,7 +33,7 @@ my sub assert_iscsi_support {
 }
 
 # Example: 192.168.122.252:3260,1 iqn.2003-01.org.linux-iscsi.proxmox-nfs.x8664:sn.00567885ba8f
-my $ISCSI_TARGET_RE = qr/^((?:$IPV4RE|\[$IPV6RE\]):\d+)\,\S+\s+(\S+)\s*$/;
+my $ISCSI_TARGET_RE = qr/^(\S+:\d+)\,\S+\s+(\S+)\s*$/;
 
 sub iscsi_session_list {
     assert_iscsi_support();
@@ -49,7 +49,7 @@ sub iscsi_session_list {
                 my $line = shift;
                 # example: tcp: [1] 192.168.122.252:3260,1 iqn.2003-01.org.linux-iscsi.proxmox-nfs.x8664:sn.00567885ba8f (non-flash)
                 if ($line =~
-                    m/^tcp:\s+\[(\S+)\]\s+((?:$IPV4RE|\[$IPV6RE\]):\d+)\,\S+\s+(\S+)\s+\S+?\s*$/
+                    m/^tcp:\s+\[(\S+)\]\s+(\S+:\d+)\,\S+\s+(\S+)\s+\S+?\s*$/
                 ) {
                     my ($session_id, $portal, $target) = ($1, $2, $3);
                     # there can be several sessions per target (multipath)
-- 
2.39.5


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH storage] iscsi: add hostname support in portal addresses
  2025-06-26  2:29 [pve-devel] [PATCH storage] iscsi: add hostname support in portal addresses Stelios Vailakakis
@ 2025-08-04 18:45 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2025-08-04 18:45 UTC (permalink / raw)
  To: pve-devel, Stelios Vailakakis

On Thu, 26 Jun 2025 02:29:20 +0000, Stelios Vailakakis wrote:
> Currently, the iSCSI plugin regex patterns only match IPv4 and IPv6
> addresses, causing session parsing to fail when portals use hostnames
> (like nas.example.com:3260).
> 
> This patch updates ISCSI_TARGET_RE and session parsing regex to accept
> any non-whitespace characters before the port, allowing hostname-based
> portals to work correctly.
> 
> [...]

Applied, thanks!

[1/1] iscsi: add hostname support in portal addresses
      commit: 6bf171ec544b184dcb33fde9eb148d8fdc361235


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-04 18:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-26  2:29 [pve-devel] [PATCH storage] iscsi: add hostname support in portal addresses Stelios Vailakakis
2025-08-04 18:45 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal