From 9cb032f8e34daad08473b5d3da19a2aedefc2db8 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 13 Aug 2013 13:50:43 +0100 Subject: [PATCH] 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 42754046269806a6b6385fee0b72115c73461221) (cherry picked from commit b312c245d3efb458609f9064a75a2f02a5181af4) --- tools/virt-list-filesystems | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/tools/virt-list-filesystems b/tools/virt-list-filesystems index 1b58d63d2..9dcba2407 100755 --- a/tools/virt-list-filesystems +++ b/tools/virt-list-filesystems @@ -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