diff -urN multipath-tools-0.1.6/ChangeLog multipath-tools-0.1.7/ChangeLog --- multipath-tools-0.1.6/ChangeLog 2004-04-25 18:44:40.000000000 +0200 +++ multipath-tools-0.1.7/ChangeLog 2004-05-10 09:58:44.000000000 +0200 @@ -1,3 +1,9 @@ +2004-05-10 multipath-tools-0.1.7 + * bugfixes from Andy : + * read the last line of the config file + * add an entry for the 3PARData storage ctlrs + * read the last char of vendor and model strings + * dmadm exits cleanly when it has nothing to do 2004-04-25 multipath-tools-0.1.6 * add the dmadm WIP tool (read MD superblocks and create corresponding devmaps when possible) Binary files multipath-tools-0.1.6/dmadm/dmadm and multipath-tools-0.1.7/dmadm/dmadm differ diff -urN multipath-tools-0.1.6/dmadm/dmadm.c multipath-tools-0.1.7/dmadm/dmadm.c --- multipath-tools-0.1.6/dmadm/dmadm.c 2004-04-01 17:45:31.000000000 +0200 +++ multipath-tools-0.1.7/dmadm/dmadm.c 2004-04-27 15:17:15.000000000 +0200 @@ -39,7 +39,7 @@ #include "md_u.h" #include "md_p.h" -#define DEBUG 1 +#define DEBUG 2 #define LOG(x, y, z...) if (DEBUG >= x) fprintf (stderr, y, ##z) #define LINEAR -1 @@ -352,9 +352,19 @@ sysfs_close_directory (sdir); /* + * we need at least one superblock to continue + */ + if (devlist == NULL) { + LOG (1, "no superblocks found\n"); + exit (0); + } + + /* * coalesce by MD UUID */ + LOG (2, "start coalescing\n"); dlist_start (devlist); + while (dlist_next (devlist)) { refdev = dlist_pop (devlist); mddevs = dlist_new (sizeof (struct device)); Binary files multipath-tools-0.1.6/dmadm/dmadm.o and multipath-tools-0.1.7/dmadm/dmadm.o differ diff -urN multipath-tools-0.1.6/multipath/configfile.c multipath-tools-0.1.7/multipath/configfile.c --- multipath-tools-0.1.6/multipath/configfile.c 2004-03-16 11:09:54.000000000 +0100 +++ multipath-tools-0.1.7/multipath/configfile.c 2004-05-06 09:40:07.000000000 +0200 @@ -133,6 +133,7 @@ } /* terminate array */ + hwe = &hw[i]; hwe->getuid = NULL; fclose (fp); diff -urN multipath-tools-0.1.6/multipath/devinfo.c multipath-tools-0.1.7/multipath/devinfo.c --- multipath-tools-0.1.6/multipath/devinfo.c 2004-03-22 13:17:50.000000000 +0100 +++ multipath-tools-0.1.7/multipath/devinfo.c 2004-05-07 08:15:28.000000000 +0200 @@ -98,88 +98,92 @@ int get_lun_strings(char * vendor_id, char * product_id, char * rev, char * devname) { - int fd; - char buff[36]; - char attr_path[FILE_NAME_SIZE]; + int fd; + char buff[36]; + char attr_path[FILE_NAME_SIZE]; + char attr_buff[17]; char sysfs_path[FILE_NAME_SIZE]; - char basedev[FILE_NAME_SIZE]; + char basedev[FILE_NAME_SIZE]; if (0 == sysfs_get_mnt_path(sysfs_path, FILE_NAME_SIZE)) { - /* sysfs style */ - basename(devname, basedev); + /* sysfs style */ + basename(devname, basedev); - sprintf(attr_path, "%s/block/%s/device/vendor", - sysfs_path, basedev); - if (0 > sysfs_read_attribute_value(attr_path, - vendor_id, 8)) return 0; + sprintf(attr_path, "%s/block/%s/device/vendor", + sysfs_path, basedev); + if (0 > sysfs_read_attribute_value(attr_path, + attr_buff, 17)) return 0; + memcpy (vendor_id, attr_buff, 8); - sprintf(attr_path, "%s/block/%s/device/model", - sysfs_path, basedev); - if (0 > sysfs_read_attribute_value(attr_path, - product_id, 16)) return 0; + sprintf(attr_path, "%s/block/%s/device/model", + sysfs_path, basedev); + if (0 > sysfs_read_attribute_value(attr_path, + attr_buff, 17)) return 0; + memcpy (product_id, attr_buff, 16); - sprintf(attr_path, "%s/block/%s/device/rev", - sysfs_path, basedev); - if (0 > sysfs_read_attribute_value(attr_path, - rev, 4)) return 0; - } else { - /* ioctl style */ - if ((fd = open(devname, O_RDONLY)) < 0) - return 0; - if (0 != do_inq(fd, 0, 0, 0, buff, 36, 1)) - return 0; - memcpy(vendor_id, &buff[8], 8); - memcpy(product_id, &buff[16], 16); - memcpy(rev, &buff[32], 4); - close(fd); - return 1; - } - return 0; + sprintf(attr_path, "%s/block/%s/device/rev", + sysfs_path, basedev); + if (0 > sysfs_read_attribute_value(attr_path, + attr_buff, 17)) return 0; + memcpy (rev, attr_buff, 4); + } else { + /* ioctl style */ + if ((fd = open(devname, O_RDONLY)) < 0) + return 0; + if (0 != do_inq(fd, 0, 0, 0, buff, 36, 1)) + return 0; + memcpy(vendor_id, &buff[8], 8); + memcpy(product_id, &buff[16], 16); + memcpy(rev, &buff[32], 4); + close(fd); + return 1; + } + return 0; } static void sprint_wwid(char * buff, const char * str) { - int i; - const char *p; - char *cursor; - unsigned char c; + int i; + const char *p; + char *cursor; + unsigned char c; - p = str; - cursor = buff; - for (i = 0; i <= WWID_SIZE / 2 - 1; i++) { - c = *p++; - sprintf(cursor, "%.2x", (int) (unsigned char) c); - cursor += 2; - } - buff[WWID_SIZE - 1] = '\0'; + p = str; + cursor = buff; + for (i = 0; i <= WWID_SIZE / 2 - 1; i++) { + c = *p++; + sprintf(cursor, "%.2x", (int) (unsigned char) c); + cursor += 2; + } + buff[WWID_SIZE - 1] = '\0'; } long get_disk_size (char * devname) { - long size; - int fd; - char attr_path[FILE_NAME_SIZE]; - char sysfs_path[FILE_NAME_SIZE]; - char buff[FILE_NAME_SIZE]; - char basedev[FILE_NAME_SIZE]; + long size; + int fd; + char attr_path[FILE_NAME_SIZE]; + char sysfs_path[FILE_NAME_SIZE]; + char buff[FILE_NAME_SIZE]; + char basedev[FILE_NAME_SIZE]; - if (0 == sysfs_get_mnt_path(sysfs_path, FILE_NAME_SIZE)) { - basename(devname, basedev); - sprintf(attr_path, "%s/block/%s/size", - sysfs_path, basedev); - if (0 > sysfs_read_attribute_value(attr_path, buff, - FILE_NAME_SIZE * sizeof(char))) - return -1; - size = atoi(buff); - return size; - } else { - if ((fd = open(devname, O_RDONLY)) < 0) - return -1; - if(!ioctl(fd, BLKGETSIZE, &size)) - return size; - } - return -1; + if (0 == sysfs_get_mnt_path(sysfs_path, FILE_NAME_SIZE)) { + basename(devname, basedev); + sprintf(attr_path, "%s/block/%s/size", + sysfs_path, basedev); + if (0 > sysfs_read_attribute_value(attr_path, buff, + FILE_NAME_SIZE * sizeof(char))) + return -1; + size = atoi(buff); + return size; + } else { + if ((fd = open(devname, O_RDONLY)) < 0) + return -1; + if(!ioctl(fd, BLKGETSIZE, &size)) + return size; + } + return -1; } int diff -urN multipath-tools-0.1.6/multipath/hwtable.h multipath-tools-0.1.7/multipath/hwtable.h --- multipath-tools-0.1.6/multipath/hwtable.h 2004-03-16 10:08:38.000000000 +0100 +++ multipath-tools-0.1.7/multipath/hwtable.h 2004-05-07 08:23:48.000000000 +0200 @@ -16,6 +16,7 @@ {"SGI ", "TP9300 ", MULTIBUS, &get_evpd_wwid}, \ {"SGI ", "TP9400 ", MULTIBUS, &get_evpd_wwid}, \ {"SGI ", "TP9500 ", MULTIBUS, &get_evpd_wwid}, \ + {"3PARdata", "VV ", GROUP_BY_TUR, &get_evpd_wwid}, \ {"", "", 0, NULL}, \ }; \ diff -urN multipath-tools-0.1.6/multipath/main.c multipath-tools-0.1.7/multipath/main.c --- multipath-tools-0.1.6/multipath/main.c 2004-03-22 13:19:29.000000000 +0100 +++ multipath-tools-0.1.7/multipath/main.c 2004-05-06 09:59:45.000000000 +0200 @@ -41,9 +41,9 @@ /* not nice */ void *getuid_list[] = { - &get_null_uid, - &get_evpd_wwid, - NULL, + &get_null_uid, /* returns 0x0 */ + &get_evpd_wwid, /* returns the LU WWID stored in EVPD page 0x83 */ + NULL, /* array terminator */ }; static int @@ -148,6 +148,7 @@ curpath->tur = do_tur (curpath->sg_dev); for (i = 0; hwtable[i].getuid; i++) { + if (strncmp (curpath->vendor_id, hwtable[i].vendor, 8) == 0 && strncmp (curpath->product_id, hwtable[i].product, 16) == 0) { @@ -164,7 +165,6 @@ return 0; } - static int get_all_paths_sysfs (struct env * conf, struct path * all_paths) { diff -urN multipath-tools-0.1.6/multipath/multipath.conf multipath-tools-0.1.7/multipath/multipath.conf --- multipath-tools-0.1.6/multipath/multipath.conf 2004-03-22 13:21:31.000000000 +0100 +++ multipath-tools-0.1.7/multipath/multipath.conf 2004-05-06 09:30:00.000000000 +0200 @@ -15,6 +15,7 @@ "COMPAQ ", "MSA1000 VOLUME ", "3", "1" "DEC ", "HSG80 ", "3", "1" "HP ", "HSV100 ", "3", "1" +"3PARdata", "VV ", "3", "1" "HP ", "A6189A ", "3", "1" "HP ", "OPEN- ", "3", "1" "DDN ", "SAN DataDirector", "3", "1"