Besides fixing the issue displayed by libparted/tests/symlink.c,
this has the added advantage that the output of parted p on one of these
devices now says:
"Disk /dev/mapper/BigVol2-lv_iscsi_disk2: 34.4GB"
Which is a lot more user friendly then the output before this patch:
"Disk /dev/dm-6: 34.4GB"
* libparted/device.c: Don't canonicalize /dev/mapper paths
---
libparted/device.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/libparted/device.c b/libparted/device.c
index 0f36a03..64da978 100644
--- a/libparted/device.c
+++ b/libparted/device.c
@@ -139,10 +139,12 @@ PedDevice*
ped_device_get (const char* path)
{
PedDevice* walk;
- char* normal_path;
+ char* normal_path = NULL;
PED_ASSERT (path != NULL, return NULL);
- normal_path = canonicalize_file_name (path);
+ /* Don't canonicalize /dev/mapper paths, see tests/symlink.c */
+ if (strncmp (path, "/dev/mapper/", 12))
+ normal_path = canonicalize_file_name (path);
if (!normal_path)
/* Well, maybe it is just that the file does not exist.
* Try it anyway. */
--
1.7.0.1
_______________________________________________
bug-parted mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-parted