because it logically belongs there, also
this makes the testing easier

Signed-off-by: Dominik Csapak <d.csa...@proxmox.com>
---
 PVE/Diskmanage.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm
index 8382045..dd2591c 100644
--- a/PVE/Diskmanage.pm
+++ b/PVE/Diskmanage.pm
@@ -266,6 +266,8 @@ sub get_udev_info {
 sub get_sysdir_info {
     my ($sysdir) = @_;
 
+    return undef if ! -d "$sysdir/device";
+
     my $data = {};
 
     my $size = file_read_firstline("$sysdir/size");
@@ -381,10 +383,8 @@ sub get_disks {
 
        my $sysdir = "/sys/block/$dev";
 
-       return if ! -d "$sysdir/device";
-
        # we do not want iscsi devices
-       return if readlink($sysdir) =~ m|host[^/]*/session[^/]*|;
+       return if -l $sysdir && readlink($sysdir) =~ m|host[^/]*/session[^/]*|;
 
        my $sysdata = get_sysdir_info($sysdir);
        return if !defined($sysdata);
-- 
2.1.4


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

Reply via email to