[PVE-User] /dev/disk/by-path/ paths not working in 1.4

Tomasz Chmielewski mangoo at wpkg.org
Sat Oct 24 01:51:30 CEST 2009


Tomasz Chmielewski wrote:

> As I see, this part of code:
> 
> sub parse_volume_id {
>     my ($volid, $noerr) = @_;
> 
>     if ($volid =~ m/^([^:]+):(.+)$/) {
> 	return wantarray ? ($1, $2) : $1;
>     }
>     return undef if $noerr;
>     die "unable to parse volume ID '$volid'\n";
> }
> 
> 
> Would expect something like this:
> 
> scsi0: san3.vw-web04:0.0.1.scsi-1IET_00140001
> 
> But it will break on such paths:
> 
> virtio0: /dev/disk/by-path/ip-192.168.112.68:3260-iscsi-iqn.2009-04.net.syneticon:san3.contact-pdc-lun-1

BTW, this change seems to fix it:

Signed off by: Tomasz Chmielewski (tch at wpkg.org)

--- Storage.pm.orig     2009-10-23 23:52:20.000000000 +0200
+++ Storage.pm  2009-10-24 01:44:29.000000000 +0200
@@ -1257,7 +1257,7 @@
  sub parse_volume_id {
      my ($volid, $noerr) = @_;

-    if ($volid =~ m/^([^:]+):(.+)$/) {
+    if ($volid =~ m/^(?!\/dev)([^:]+):(.+)$/) {
         return wantarray ? ($1, $2) : $1;
      }
      return undef if $noerr;


-- 
Tomasz Chmielewski
http://wpkg.org



More information about the pve-user mailing list