[pve-devel] [PATCH storage 1/5] use /sys/block/ path for udev instead of name

Dominik Csapak d.csapak at proxmox.com
Mon Oct 17 10:29:08 CEST 2016


since we iterate over the entries in /sys/block
it makes sense to use this path

this should fix #1099
because udevadm does not take
 -n cciss!c0d0 (because it only looks in dev for this)
but takes
 -p /sys/block/cciss!c0d0

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/Diskmanage.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm
index 6cc5e1c..8382045 100644
--- a/PVE/Diskmanage.pm
+++ b/PVE/Diskmanage.pm
@@ -217,7 +217,7 @@ sub get_udev_info {
     my $info = "";
     my $data = {};
     eval {
-	run_command([$UDEVADM, 'info', '-n', $dev, '--query', 'all'], outfunc => sub {
+	run_command([$UDEVADM, 'info', '-p', $dev, '--query', 'all'], outfunc => sub {
 	    my ($line) = @_;
 	    $info .= "$line\n";
 	});
@@ -375,7 +375,7 @@ sub get_disks {
 		  $dev !~ m/^nvme\d+n\d+$/ &&
 		  $dev !~ m/^cciss\!c\d+d\d+$/;
 
-	my $data = get_udev_info($dev);
+	my $data = get_udev_info("/sys/block/$dev");
 	return if !defined($data);
 	my $devpath = $data->{devpath};
 
-- 
2.1.4





More information about the pve-devel mailing list