5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2025-02-28 01:58:06 +03:00

use /sys/block/ path for udev instead of name

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@proxmox.com>
This commit is contained in:
Dominik Csapak 2016-10-17 10:29:08 +02:00 committed by Dietmar Maurer
parent 261e80da66
commit 532e89e7be

View File

@ -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};