[parted-devel] [PATCH] detect device map type

Guido Günther agx at sigxcpu.org
Fri Jun 6 07:24:58 UTC 2008


On Fri, Jun 06, 2008 at 09:00:14AM +0200, Jim Meyering wrote:
> diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
> index 67b8fb6..04107d8 100644
> --- a/libparted/arch/linux.c
> +++ b/libparted/arch/linux.c
> @@ -1158,6 +1158,7 @@ linux_new (const char* path)
>          if (!dev)
>                  goto error;
> 
> +        dev->dmtype = NULL;
>          dev->path = strdup (path);
>          if (!dev->path)
>                  goto error_free_dev;
That's fine but it needs a #ifdef ENABLE_DEVICE_MAPPER too. I was under
the impression that the whole PedDevice* struct would be initialized to
zero - maybe that changed or I was just lucky it eneded up being zero in
my tests. Thanks for fixing that.

While looking at the code I wonder if we should move the whole dmtype
into LinuxSpecific (since it is)? Let me know and I post a patch.

[..snip..] 
> I'm copying more of the lvm-related testing framework, so it will
> be easier to keep things in sync.  Did those lvm-specific functions
> cause trouble?
No they didn't - they just thought they weren't needed. So I removed
them, it makes sense to keep them if we intend to keep the file in sync
with lvm.
Cheers,
 -- Guido



More information about the parted-devel mailing list