[parted-devel] [PATCH] Add support for ATA over Ethernet devices

Petr Uzel petr.uzel at suse.cz
Fri Feb 26 16:59:24 UTC 2010


Recognize AoE Devices, so "parted -s /dev/etherd/eX.Y" now
prints "Model: ATA over Ethernet Device (aoe)" instead of
"Model: Unknown (unknown)".

* include/parted/device.h(PedDeviceType): Add PED_DEVICE_AOE.
* libparted/arch/linux.c(AOE_MAJOR): New define.
* libparted/arch/linux.c(_device_probe_type): Recognize AoE devices.
* libparted/arch/linux.c(linux_new): Handle AoE devices.
* parted/parted.c(do_print): Add "aoe" to the list of available
  transports.
---
 include/parted/device.h |    3 ++-
 libparted/arch/linux.c  |    8 ++++++++
 parted/parted.c         |    2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/include/parted/device.h b/include/parted/device.h
index 3580c2a..764c246 100644
--- a/include/parted/device.h
+++ b/include/parted/device.h
@@ -46,7 +46,8 @@ typedef enum {
         PED_DEVICE_DM           = 12,
         PED_DEVICE_XVD          = 13,
         PED_DEVICE_SDMMC        = 14,
-        PED_DEVICE_VIRTBLK      = 15
+        PED_DEVICE_VIRTBLK      = 15,
+        PED_DEVICE_AOE          = 16
 } PedDeviceType;
 
 typedef struct _PedDevice PedDevice;
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 49ab08c..1fb5ab7 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -249,6 +249,7 @@ struct blkdev_ioctl_param {
 #define UBD_MAJOR               98
 #define DASD_MAJOR              94
 #define VIODASD_MAJOR           112
+#define AOE_MAJOR               152
 #define SX8_MAJOR1              160
 #define SX8_MAJOR2              161
 #define XVD_MAJOR               202
@@ -540,6 +541,8 @@ _device_probe_type (PedDevice* dev)
                 dev->type = PED_DEVICE_DAC960;
         } else if (dev_major == ATARAID_MAJOR && (dev_minor % 0x10 == 0)) {
                 dev->type = PED_DEVICE_ATARAID;
+        } else if (dev_major == AOE_MAJOR && (dev_minor % 0x10 == 0)) {
+                dev->type = PED_DEVICE_AOE;
         } else if (dev_major == DASD_MAJOR && (dev_minor % 0x4 == 0)) {
                 dev->type = PED_DEVICE_DASD;
         } else if (dev_major == VIODASD_MAJOR && (dev_minor % 0x8 == 0)) {
@@ -1313,6 +1316,11 @@ linux_new (const char* path)
                         goto error_free_arch_specific;
                 break;
 
+        case PED_DEVICE_AOE:
+                if (!init_generic (dev, _("ATA over Ethernet Device")))
+                    goto error_free_arch_specific;
+                break;
+
 #if defined __s390__ || defined __s390x__
         case PED_DEVICE_DASD:
                 if (!init_dasd (dev, _("IBM S390 DASD drive")))
diff --git a/parted/parted.c b/parted/parted.c
index 44f8255..ae6fd6f 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1396,7 +1396,7 @@ 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"};
+                                         "xvd", "sd/mmc", "virtblk", "aoe"};
         char*           peek_word;
         char*           start;
         char*           end;
-- 
1.6.4.2


Petr

--
Petr Uzel, openSUSE Boosters Team
IRC: ptr_uzl @ freenode
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20100226/adb48ba2/attachment.pgp>


More information about the parted-devel mailing list