[parted-devel] [PATCH] Fix device-mapper partition path detection

Guido Günther agx at sigxcpu.org
Wed Jun 4 16:55:41 UTC 2008


On Tue, May 27, 2008 at 09:43:37PM -0300, Otavio Salvador wrote:
> We copy dev->path to result since it doesn't has a partition number.
In general device mapper devices can be partitioned, you'd have to
decide by map type what to do (which is basically what the patches I
sent do).
 -- Guido
> ---
>  libparted/arch/linux.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
> index c332cf8..2f4c368 100644
> --- a/libparted/arch/linux.c
> +++ b/libparted/arch/linux.c
> @@ -1970,12 +1970,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) {
> +                strcpy(result, dev->path);
> +#endif
>          } else if (dev->type == PED_DEVICE_DAC960
>                          || dev->type == PED_DEVICE_CPQARRAY
>                          || dev->type == PED_DEVICE_ATARAID
> -#ifdef ENABLE_DEVICE_MAPPER
> -                        || dev->type == PED_DEVICE_DM
> -#endif
>                          || isdigit (dev->path[path_len - 1]))
>                  snprintf (result, result_len, "%sp%d", dev->path, num);
>          else
> -- 
> 1.5.5.1
> 
> 
> _______________________________________________
> parted-devel mailing list
> parted-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/parted-devel



More information about the parted-devel mailing list