public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Daniel Kral" <d.kral@proxmox.com>
To: "Felix Driessler" <fdriessler@inett.de>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH pve-stoage 3/4] iscsiPlugin: add wwid
Date: Thu, 23 Apr 2026 15:06:47 +0200	[thread overview]
Message-ID: <DI0K2C76YNMK.DDB2DDLPSUFL@proxmox.com> (raw)
In-Reply-To: <20260327101456.16614-4-fdriessler@inett.de>

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 <fdriessler@inett.de>
> ---
>  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 {
>  
>                      my $volid = "$channel.$id.$lun.$blockdev";
>  
> +                    my $wwid = '';
> +                    my $dev = "/dev/$bdev";
> +                    $dev =~ m|^(/dev/[A-Za-z0-9_\-./]+)$|
> +                        or die "Invalid device path";
> +                    $dev = $1;
> +                    run_command(['/lib/udev/scsi_id', '-g', '-u', '-d', $dev], outfunc => sub { $wwid .= "$_[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 = 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=v7.0#n3348

> +
>                      $res->{$target}->{$volid} = {
> -                        'format' => 'raw',
> -                        'size' => int($size * 512),
> -                        'vmid' => 0, # not assigned to any vm
> -                        'channel' => int($channel),
> -                        'id' => int($id),
> -                        'lun' => int($lun),
> +                        'format'    => 'raw',
> +                        'size'      => int($size * 512),
> +                        'vmid'      => 0, # not assigned to any vm
> +                        'channel'   => int($channel),
> +                        'id'        => int($id),
> +                        'lun'       => 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'      => $wwid

nit: add a , at the end of the new property

>                      };
>  
>                      #print "TEST: $target $session $host,$bus,$tg,$lun $blockdev\n";




  reply	other threads:[~2026-04-23 13:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f53ca227-2275-443f-84f8-48b2785269b2.2bc2ceb6-a3a3-4c49-9566-519c7d2ab20e.21103ee5-34fe-43b6-b130-08f8ab2b25ae@emailsignatures365.codetwo.com>
2026-03-27 10:14 ` [PATCH pve-manager/pve-storage 0/4] extend iscsi configuration Felix Driessler
     [not found]   ` <f53ca227-2275-443f-84f8-48b2785269b2.2bc2ceb6-a3a3-4c49-9566-519c7d2ab20e.d935a384-10c1-4974-ba2a-7adab51bb127@emailsignatures365.codetwo.com>
2026-03-27 10:14     ` [PATCH pve-manager 1/4] ui: Add Display of WWID for ISCSI Felix Driessler
     [not found]   ` <f53ca227-2275-443f-84f8-48b2785269b2.2bc2ceb6-a3a3-4c49-9566-519c7d2ab20e.5ac71d0a-bc32-41c3-8898-7681716f7a92@emailsignatures365.codetwo.com>
2026-03-27 10:14     ` [PATCH pve-manager 2/4] ui: Add CHAP Authentication " Felix Driessler
     [not found]   ` <f53ca227-2275-443f-84f8-48b2785269b2.2bc2ceb6-a3a3-4c49-9566-519c7d2ab20e.24fbb610-73bc-4d0e-8ec7-c0b5fbde4ff8@emailsignatures365.codetwo.com>
2026-03-27 10:14     ` [PATCH pve-stoage 3/4] iscsiPlugin: add wwid Felix Driessler
2026-04-23 13:06       ` Daniel Kral [this message]
2026-04-23 15:21         ` Felix Driessler - inett GmbH
     [not found]   ` <f53ca227-2275-443f-84f8-48b2785269b2.2bc2ceb6-a3a3-4c49-9566-519c7d2ab20e.6c58b149-eb37-45dd-84d7-651f4453edab@emailsignatures365.codetwo.com>
2026-03-27 10:14     ` [PATCH pve-stoage 4/4] iscsiPlugin: add chap auth Felix Driessler
     [not found]   ` <f53ca227-2275-443f-84f8-48b2785269b2.2bc2ceb6-a3a3-4c49-9566-519c7d2ab20e.cd811509-5a7f-4f83-8a2f-cdaa4c6afefd@emailsignatures365.codetwo.com>
2026-04-23 11:19     ` [PATCH pve-manager/pve-storage 0/4] extend iscsi configuration Felix Driessler - inett GmbH
     [not found] <f53ca227-2275-443f-84f8-48b2785269b2.2bc2ceb6-a3a3-4c49-9566-519c7d2ab20e.6280bc33-152c-4cc8-b1f7-ae5c6d73e0f3@emailsignatures365.codetwo.com>
2026-04-23 15:14 ` [PATCH pve-stoage 3/4] iscsiPlugin: add wwid Felix Drießler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DI0K2C76YNMK.DDB2DDLPSUFL@proxmox.com \
    --to=d.kral@proxmox.com \
    --cc=fdriessler@inett.de \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal