[Parted-commits] GNU Parted Official Repository: Changes to 'debian/master'

Otavio Salvador otavio at alioth.debian.org
Sat Aug 9 22:06:33 UTC 2008


 configure.ac           |    6 ++--
 debian/changelog       |   11 ++++++++
 debian/rules           |    4 +--
 include/parted/linux.h |    1 
 libparted/arch/linux.c |   65 ++++++++++++++++++++++++++++++++++++++++++++++++-
 5 files changed, 81 insertions(+), 6 deletions(-)

New commits:
commit 61408f7fe152ee2698fe16a9a1778a3f3977b07c
Author: Otavio Salvador <otavio at ossystems.com.br>
Date:   Sat Aug 9 18:52:31 2008 -0300

    Release 1.8.8.git.2008.03.24-9

diff --git a/debian/changelog b/debian/changelog
index 27995d3..f5a3985 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+parted (1.8.8.git.2008.03.24-9) unstable; urgency=low
+
+  [ Otavio Salvador ]
+  * Bump package soname
+
+  [ Guido Günther ]
+  * Return the correct partition names for multipath devices
+  * linux device-mapper map type detection (closes: #440675)
+
+ -- Otavio Salvador <otavio at ossystems.com.br>  Sat, 09 Aug 2008 18:51:31 -0300
+
 parted (1.8.8.git.2008.03.24-8) unstable; urgency=low
 
   * Disable backtrace when building the udeb packages (closes: #488374).

commit 6dc1aa92e921af690e8f007a30cc19913933225e
Author: Otavio Salvador <otavio at ossystems.com.br>
Date:   Sat Aug 9 17:47:35 2008 -0300

    Bump package soname

diff --git a/configure.ac b/configure.ac
index 9f0971b..b121822 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@ dnl
 dnl This file may be modified and/or distributed without restriction.
 
 AC_PREREQ(2.61)
-AC_INIT([GNU parted],[1.8.9],[bug-parted at gnu.org])
+AC_INIT([GNU parted],[1.8.8],[bug-parted at gnu.org])
 
 AC_CONFIG_SRCDIR(include/parted/parted.h)
 
@@ -24,14 +24,14 @@ dnl function signatures changed),
 dnl set PED_BINARY_AGE _and_ PED_INTERFACE_AGE to 0.
 PED_MAJOR_VERSION=1
 PED_MINOR_VERSION=8
-PED_MICRO_VERSION=9
+PED_MICRO_VERSION=8
 PED_INTERFACE_AGE=0
 PED_BINARY_AGE=0
 PED_VERSION_SUFFIX=
 PED_VERSION=$PED_MAJOR_VERSION.$PED_MINOR_VERSION.$PED_MICRO_VERSION$PED_VERSION_SUFFIX
 
 LT_RELEASE=$PED_MAJOR_VERSION.$PED_MINOR_VERSION
-LT_CURRENT=`expr $PED_MICRO_VERSION - $PED_INTERFACE_AGE`
+LT_CURRENT=10
 LT_REVISION=$PED_INTERFACE_AGE
 LT_AGE=`expr $PED_BINARY_AGE - $PED_INTERFACE_AGE`
 AC_SUBST(LT_RELEASE)
diff --git a/debian/rules b/debian/rules
index b75b15a..aad0e5a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -39,11 +39,11 @@ LIBPKGVER = 1.8
 
 # The first version of the package to build with the current LIBPKGVER
 # This should be changed to the current version when LIBPKGVER is changed ...
-DEPVER = 1.8.8.git.2008.03.24-3
+DEPVER = 1.8.8.git.2008.03.24-9
 
 # This is the library's soname. The build will fail if this is wrong, since
 # if the soname has changed we need to update stuff ...
-LIBSONAME = 9
+LIBSONAME = 10
 
 # This is for the version for the shared library
 SHAREDLIBPKGVER = $(LIBPKGVER)-$(LIBSONAME)

commit 58ac9b901ae614586306bc757c81798e1f706ea6
Author: Guido Günther <agx at sigxcpu.org>
Date:   Tue Jun 10 18:35:41 2008 +0200

    Return the correct partition names for multipath devices

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 14baa69..3d84373 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2015,6 +2015,7 @@ _device_get_part_path (PedDevice* dev, int num)
         int             path_len = strlen (dev->path);
         int             result_len = path_len + 16;
         char*           result;
+        LinuxSpecific*  arch_specific = LINUX_SPECIFIC (dev);
 
         result = (char*) ped_malloc (result_len);
         if (!result)
@@ -2027,6 +2028,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 && arch_specific->dmtype &&
+                   strcmp(arch_specific->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

commit 855b8646f58c4b232d5f011be1c52f38d71ff68c
Author: Guido Guenther <agx at sigxcpu.org>
Date:   Thu Aug 7 12:11:36 2008 +0200

    linux device-mapper map type detection
    
    detect the type of the device map and add it to the displayed type
    information. This is also included in upstream parted.

diff --git a/include/parted/linux.h b/include/parted/linux.h
index 05a2f0e..1b0d8f8 100644
--- a/include/parted/linux.h
+++ b/include/parted/linux.h
@@ -32,6 +32,7 @@ typedef	struct _LinuxSpecific	LinuxSpecific;
 
 struct _LinuxSpecific {
 	int	fd;
+	char*	dmtype;         /**< device map target type */
 #if defined(__s390__) || defined(__s390x__)
 	unsigned int real_sector_size;
 	/* IBM internal dasd structure (i guess ;), required. */
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 9876956..14baa69 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -301,6 +301,44 @@ _is_sx8_major (int major)
 
 #ifdef ENABLE_DEVICE_MAPPER
 static int
+_dm_maptype (PedDevice* dev)
+{
+        LinuxSpecific*  arch_specific = LINUX_SPECIFIC (dev);
+        struct dm_task *dmt;
+        void *next = NULL;
+        uint64_t start, length;
+        char *target_type = NULL;
+        char *params;
+        int r = -1;
+        const char* dev_dir = getenv ("DM_DEV_DIR");
+
+        if (dev_dir && *dev_dir && !dm_set_dev_dir(dev_dir))
+                return r;
+
+        if (!(dmt = dm_task_create(DM_DEVICE_TABLE)))
+                return r;
+
+        if (!dm_task_set_name(dmt, dev->path))
+                goto bad;
+
+        dm_task_no_open_count(dmt);
+
+        if (!dm_task_run(dmt))
+                goto bad;
+
+        next = dm_get_next_target(dmt, next, &start, &length,
+                                  &target_type, &params);
+
+        arch_specific->dmtype = strdup(target_type);
+        if (arch_specific->dmtype == NULL)
+                goto bad;
+        r = 0;
+bad:
+        dm_task_destroy(dmt);
+        return r;
+}
+
+static int
 readFD (int fd, char **buf)
 {
         char* p;
@@ -488,6 +526,12 @@ _device_probe_type (PedDevice* dev)
 #ifdef ENABLE_DEVICE_MAPPER
         } else if (_is_dm_major(dev_major)) {
                 dev->type = PED_DEVICE_DM;
+                if (_dm_maptype(dev)) {
+                        LinuxSpecific*  arch_specific = LINUX_SPECIFIC (dev);
+
+                        arch_specific = LINUX_SPECIFIC (dev);
+                        arch_specific->dmtype = strdup("unknown");
+		}
 #endif
         } else if (dev_major == XVD_MAJOR && (dev_minor % 0x10 == 0)) {
                 dev->type = PED_DEVICE_XVD;
@@ -1105,6 +1149,8 @@ static PedDevice*
 linux_new (const char* path)
 {
         PedDevice*      dev;
+        char* type;
+        LinuxSpecific*  arch_specific;
 
         PED_ASSERT (path != NULL, return NULL);
 
@@ -1120,6 +1166,8 @@ linux_new (const char* path)
                 = (LinuxSpecific*) ped_malloc (sizeof (LinuxSpecific));
         if (!dev->arch_specific)
                 goto error_free_path;
+        arch_specific = LINUX_SPECIFIC (dev);
+        arch_specific->dmtype = NULL;
 
         dev->open_count = 0;
         dev->read_only = 0;
@@ -1188,7 +1236,11 @@ linux_new (const char* path)
 
 #ifdef ENABLE_DEVICE_MAPPER
         case PED_DEVICE_DM:
-                if (!init_generic (dev, _("Linux device-mapper")))
+                if (arch_specific->dmtype == NULL
+                      || asprintf(&type, _("Linux device-mapper (%s)"),
+                                  arch_specific->dmtype) == -1)
+                        goto error_free_arch_specific;
+                if (!init_generic (dev, type))
                         goto error_free_arch_specific;
                 break;
 #endif
@@ -1227,6 +1279,9 @@ linux_destroy (PedDevice* dev)
         ped_free (dev->arch_specific);
         ped_free (dev->path);
         ped_free (dev->model);
+#ifdef ENABLE_DEVICE_MAPPER
+        ped_free (((LinuxSpecific*)dev->arch_specific)->dmtype);
+#endif
         ped_free (dev);
 }
 



More information about the Parted-commits mailing list