bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] add AoE support to parted


From: Ed L Cashin
Subject: [PATCH] add AoE support to parted
Date: Tue, 28 Sep 2004 15:24:24 -0400
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux)

Hi.  While working with Thomas Fehr from Suse on YaST support for
EtherDrive storage blades, we found out that parted was not telling
the kernel to re-read the partition table after modifying it.

Currently parted has a list of recognized block devices in linux.c.
The problem there is that parted must be updated every time a new
block device comes along.

Ideally, it seems like the init_file function would be for files and
init_generic would be for generic block devices, but the way linux.c
works now, unrecognized block devices go through the init_file
function.

Would it be problematic for parted to have the kernel re-read the
partition table in the common case?  That way, unknown block devices
would "just work".

The patch below doesn't make that change but is instead a minimal
patch, adding support for UBD and ATA over Ethernet block devices
without changing the parted design.  This patch was created with the
stable parted source from CVS and applies cleanly to parted-1.6.15.

Index: include/parted/device.h
===================================================================
RCS file: /cvsroot/parted/stable/include/parted/device.h,v
retrieving revision 1.2
diff -u -r1.2 device.h
--- include/parted/device.h     15 Aug 2004 22:45:28 -0000      1.2
+++ include/parted/device.h     28 Sep 2004 19:05:12 -0000
@@ -33,7 +33,9 @@
        PED_DEVICE_CPQARRAY     = 4,
        PED_DEVICE_FILE         = 5,
        PED_DEVICE_ATARAID      = 6,
-       PED_DEVICE_I2O          = 7
+       PED_DEVICE_I2O          = 7,
+       PED_DEVICE_UBD          = 8,
+       PED_DEVICE_AOE          = 9, /* ATA over Ethernet */
 } PedDeviceType;
 
 typedef struct _PedDevice PedDevice;
Index: libparted/linux.c
===================================================================
RCS file: /cvsroot/parted/stable/libparted/linux.c,v
retrieving revision 1.4
diff -u -r1.4 linux.c
--- libparted/linux.c   9 Sep 2004 12:46:04 -0000       1.4
+++ libparted/linux.c   28 Sep 2004 19:05:13 -0000
@@ -214,6 +214,8 @@
 #define I2O_MAJOR6             85
 #define I2O_MAJOR7             86
 #define I2O_MAJOR8             87
+#define UBD_MAJOR              98
+#define AOE_MAJOR              152
 
 #define SCSI_BLK_MAJOR(M) (                                            \
                (M) == SCSI_DISK0_MAJOR                                 \
@@ -306,6 +308,10 @@
                dev->type = PED_DEVICE_I2O;
        } else if (_is_cpqarray_major (dev_major) && (dev_minor % 0x10 == 0)) {
                dev->type = PED_DEVICE_CPQARRAY;
+       } else if (dev_major == UBD_MAJOR && (dev_minor % 0x10 == 0)) {
+               dev->type = PED_DEVICE_UBD;
+       } else if (dev_major == AOE_MAJOR && (dev_minor % 0x10 == 0)) {
+               dev->type = PED_DEVICE_AOE;
        } else {
                dev->type = PED_DEVICE_FILE;
        }
@@ -806,6 +812,16 @@
 
        case PED_DEVICE_I2O:
                if (!init_generic (dev, _("I2O Controller")))
+                       goto error_free_dev;
+               break;
+
+       case PED_DEVICE_UBD:
+               if (!init_generic (dev, _("UBD Driver")))
+                       goto error_free_dev;
+               break;
+
+       case PED_DEVICE_AOE:
+               if (!init_generic (dev, _("AoE Driver")))
                        goto error_free_dev;
                break;
 

-- 
  Ed L Cashin <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]