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

Jim Meyering meyering at alioth.debian.org
Fri Apr 16 08:36:04 UTC 2010


 .gitignore              |    2 ++
 NEWS                    |    2 ++
 include/parted/device.h |    3 ++-
 libparted/arch/linux.c  |    8 ++++++++
 parted/parted.c         |    3 ++-
 5 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 123bd7503c1bb8e833eec31850daa8f08db60020
Author: Petr Uzel <petr.uzel at suse.cz>
Date:   Fri Apr 16 10:01:08 2010 +0200

    .gitignore: ignore index files generated by ctags and cscope

diff --git a/.gitignore b/.gitignore
index 6e4c561..609109c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,7 @@ config.hin
 config.log
 config.status
 configure
+cscope.out
 doc/C/po/parted.8.pot
 doc/pt_BR/parted.8.pt_BR.po
 gnulib-tests
@@ -47,6 +48,7 @@ parted.spec
 partprobe/partprobe
 po/.reference
 stamp-h1
+tags
 tests/init.sh
 tests/print-align
 tests/t*.sh.log

commit c47b2ca7d0fb5d79b944d45d1ee8e5d1134416df
Author: Petr Uzel <petr.uzel at suse.cz>
Date:   Fri Apr 16 10:01:29 2010 +0200

    libparted: add support for Linux software RAID arrays (mdraid)
    
    Recognize MD devices, so "parted -s /dev/md0 print" now prints
    "Model: Linux Software RAID Array (md)" instead of
    "Model: Unknown (unknown)".
    
    * include/parted/device.h (PedDeviceType): Add PED_DEVICE_MD.
    * libparted/arch/linux.c (MD_MAJOR): New define.
    * libparted/arch/linux.c (_device_probe_type): Recognize MD array.
    * libparted/arch/linux.c (linux_new): Handle MD array.
    * parted/parted.c(do_print): Add "md" to the list of available
    transports.
    * NEWS (New features): Mention it.

diff --git a/NEWS b/NEWS
index 8e678db..c5c2182 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ GNU parted NEWS                                    -*- outline -*-
 
   parted now recognizes ATA over Ethernet (AoE) devices
 
+  parted now recognizes Linux Software RAID Arrays
+
 ** Bug fixes
 
   When libparted deferenced a /dev/mapper/foo symlink, it would keep the
diff --git a/include/parted/device.h b/include/parted/device.h
index bfeafed..5ca3f12 100644
--- a/include/parted/device.h
+++ b/include/parted/device.h
@@ -47,7 +47,8 @@ typedef enum {
         PED_DEVICE_XVD          = 13,
         PED_DEVICE_SDMMC        = 14,
         PED_DEVICE_VIRTBLK      = 15,
-        PED_DEVICE_AOE          = 16
+        PED_DEVICE_AOE          = 16,
+        PED_DEVICE_MD           = 17
 } PedDeviceType;
 
 typedef struct _PedDevice PedDevice;
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index c75cf9e..85cf813 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -255,6 +255,7 @@ struct blkdev_ioctl_param {
 #define XVD_MAJOR               202
 #define SDMMC_MAJOR             179
 #define LOOP_MAJOR              7
+#define MD_MAJOR                9
 
 #define SCSI_BLK_MAJOR(M) (                                             \
                 (M) == SCSI_DISK0_MAJOR                                 \
@@ -574,6 +575,8 @@ _device_probe_type (PedDevice* dev)
                 dev->type = PED_DEVICE_VIRTBLK;
         } else if (dev_major == LOOP_MAJOR) {
                 dev->type = PED_DEVICE_FILE;
+        } else if (dev_major == MD_MAJOR) {
+                dev->type = PED_DEVICE_MD;
         } else {
                 dev->type = PED_DEVICE_UNKNOWN;
         }
@@ -1381,6 +1384,11 @@ linux_new (const char* path)
                         goto error_free_arch_specific;
                 break;
 
+        case PED_DEVICE_MD:
+                if (!init_generic(dev, _("Linux Software RAID Array")))
+                        goto error_free_arch_specific;
+                break;
+
         default:
                 ped_exception_throw (PED_EXCEPTION_NO_FEATURE,
                                 PED_EXCEPTION_CANCEL,
diff --git a/parted/parted.c b/parted/parted.c
index ae6fd6f..cd1189c 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1396,7 +1396,8 @@ do_print (PedDevice** dev)
         const char *const transport[] = {"unknown", "scsi", "ide", "dac960",
                                          "cpqarray", "file", "ataraid", "i2o",
                                          "ubd", "dasd", "viodasd", "sx8", "dm",
-                                         "xvd", "sd/mmc", "virtblk", "aoe"};
+                                         "xvd", "sd/mmc", "virtblk", "aoe",
+                                         "md"};
         char*           peek_word;
         char*           start;
         char*           end;



More information about the Parted-commits mailing list