[PATCH] Return the correct partition name's for mp devices

Guido Guenther agx at sigxcpu.org
Tue May 13 16:21:06 UTC 2008


---
 libparted/arch/linux.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index b8e11c5..c98ac77 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2016,6 +2016,13 @@ _device_get_part_path (PedDevice* dev, int num)
                 /* replace /disc with /path%d */
                 strcpy (result, dev->path);
                 snprintf (result + path_len - 5, 16, "/part%d", num);
+#ifdef ENABLE_DEVICE_MAPPER
+        } else if (dev->type == PED_DEVICE_DM && dev->dmtype &&
+                   strcmp(dev->dmtype, "multipath") == 0) {
+                /* This is what multipath-tools upstream and Debian uses, it's
+                 * a pure userpace (udev) decision! */
+                snprintf (result, result_len, "%s-part%d", dev->path, num);
+#endif
         } else if (dev->type == PED_DEVICE_DAC960
                         || dev->type == PED_DEVICE_CPQARRAY
                         || dev->type == PED_DEVICE_ATARAID
-- 
1.5.5.1


--a8Wt8u1KmwUX3Y2C--



More information about the parted-devel mailing list