virt-list-filesystems: Fix to use $g->canonical_device_name instead of homebrew function.

The homebrew function didn't recognize /dev/ubd* device names, and in
any case using the API function is shorter and clearer.

(cherry picked from commit 4275404626)
(cherry picked from commit b312c245d3)
This commit is contained in:
Richard W.M. Jones
2013-08-13 13:50:43 +01:00
parent f3630d2203
commit 9cb032f8e3

View File

@@ -167,7 +167,7 @@ foreach $dev (sort keys %fses) {
$fstype = $fses{$dev};
if ($all || ($fstype ne "swap" && $fstype ne "unknown")) {
print canonicalize($dev);
print $g->canonical_device_name ($dev);
if ($long) {
print " $fstype";
}
@@ -175,18 +175,6 @@ foreach $dev (sort keys %fses) {
}
}
# The reverse of device name translation, see
# BLOCK DEVICE NAMING in guestfs(3).
sub canonicalize
{
local $_ = shift;
if (m{^/dev/[hv]d([a-z]\d)$}) {
return "/dev/sd$1";
}
$_;
}
=head1 SHELL QUOTING
Libvirt guest names can contain arbitrary characters, some of which