search for: _canonical_dev

Displaying 1 result from an estimated 1 matches for "_canonical_dev".

2009 Oct 01
1
[PATCH] inspector: Canonicalize device names (fix RHBZ#526717).
...dex a9868e2..068cde5 100644 --- a/perl/lib/Sys/Guestfs/Lib.pm +++ b/perl/lib/Sys/Guestfs/Lib.pm @@ -575,7 +575,19 @@ sub inspect_all_partitions my $g = shift; my $parts = shift; my @parts = @$parts; - return map { $_ => inspect_partition ($g, $_, @_) } @parts; + return map { _canonical_dev ($_) => inspect_partition ($g, $_, @_) } @parts; +} + +# Turn /dev/vd* and /dev/hd* into canonical device names +# (see BLOCK DEVICE NAMING in guestfs(3)). + +sub _canonical_dev +{ + local $_ = shift; + + return "/dev/sd$1" if m{^/dev/hd(\w+)}; + return "/dev/sd$1" i...