From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id A1CBA1FF13F for ; Thu, 23 Apr 2026 15:07:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 756F517D4C; Thu, 23 Apr 2026 15:07:25 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 23 Apr 2026 15:06:47 +0200 Message-Id: Subject: Re: [PATCH pve-stoage 3/4] iscsiPlugin: add wwid From: "Daniel Kral" To: "Felix Driessler" , X-Mailer: aerc 0.21.0-136-gdb9fe9896a79-dirty References: <20260327101456.16614-1-fdriessler@inett.de> <20260327101456.16614-4-fdriessler@inett.de> In-Reply-To: <20260327101456.16614-4-fdriessler@inett.de> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1776949518462 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.079 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [iscsiplugin.pm] Message-ID-Hash: UE5FD64I5ZD5JUPFE4VTEQSJDQYYELVT X-Message-ID-Hash: UE5FD64I5ZD5JUPFE4VTEQSJDQYYELVT X-MailFrom: d.kral@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Thanks for the patch! Some notes inline On Fri Mar 27, 2026 at 11:14 AM CET, Felix Driessler wrote: > Signed-off-by: Felix Driessler > --- > src/PVE/Storage/ISCSIPlugin.pm | 20 ++++++++++++++------ > 1 file changed, 14 insertions(+), 6 deletions(-) > > diff --git a/src/PVE/Storage/ISCSIPlugin.pm b/src/PVE/Storage/ISCSIPlugin= .pm > index 30f4178..bb5576b 100644 > --- a/src/PVE/Storage/ISCSIPlugin.pm > +++ b/src/PVE/Storage/ISCSIPlugin.pm > @@ -305,13 +305,21 @@ sub iscsi_device_list { > =20 > my $volid =3D "$channel.$id.$lun.$blockdev"; > =20 > + my $wwid =3D ''; > + my $dev =3D "/dev/$bdev"; > + $dev =3D~ m|^(/dev/[A-Za-z0-9_\-./]+)$| > + or die "Invalid device path"; > + $dev =3D $1; > + run_command(['/lib/udev/scsi_id', '-g', '-u', '-d', = $dev], outfunc =3D> sub { $wwid .=3D "$_[0]" }); Only a suggestion and haven't tested this extensively yet: Since this code block already enumerates the iSCSI devices through the relevant sysfs, we can also fetch the wwid with: my $wwid =3D file_read_firstline("/sys/bus/scsi/devices/$tmp/wwid"); Though this does have a different output depending on the WWN type [0] and this should probably also check whether the device actually has a WWID (just a check whether the file 'wwid' exists). [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree= /drivers/scsi/scsi_lib.c?h=3Dv7.0#n3348 > + > $res->{$target}->{$volid} =3D { > - 'format' =3D> 'raw', > - 'size' =3D> int($size * 512), > - 'vmid' =3D> 0, # not assigned to any vm > - 'channel' =3D> int($channel), > - 'id' =3D> int($id), > - 'lun' =3D> int($lun), > + 'format' =3D> 'raw', > + 'size' =3D> int($size * 512), > + 'vmid' =3D> 0, # not assigned to any vm > + 'channel' =3D> int($channel), > + 'id' =3D> int($id), > + 'lun' =3D> int($lun), Aligning the indentation of the other existing properties should be done in a separate patch before this. Though our `make tidy` target will revert this back to the previous formatting. > + 'wwid' =3D> $wwid nit: add a , at the end of the new property > }; > =20 > #print "TEST: $target $session $host,$bus,$tg,$lun $= blockdev\n";