X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=extras%2Fmultipath%2Fmain.c;h=9402888c58a3c91872a11ab2b3796c54d4f1253b;hp=e62d7632522588583749d9a7087b1958c1542df5;hb=9e919aa4f0e6f1ab2e6f9871d550a4f59bb3ed0c;hpb=61f76f5c9c12ec612458f515516b71a23b9410dd diff --git a/extras/multipath/main.c b/extras/multipath/main.c index e62d76325..9402888c5 100644 --- a/extras/multipath/main.c +++ b/extras/multipath/main.c @@ -160,8 +160,11 @@ get_serial (int fd, char * str) */ /* hardware vendor specifics : add support for new models below */ + +/* this one get EVPD page 0x83 off 8 */ +/* tested ok with StorageWorks */ static int -get_storageworks_wwid(int fd, char *str) +get_evpd_wwid(int fd, char *str) { char buff[64]; @@ -176,12 +179,39 @@ get_storageworks_wwid(int fd, char *str) static int get_unique_id(int fd, struct path * mypath) { - if (strncmp(mypath->product_id, "HSV110 (C)COMPAQ", 16) == 0 || - strncmp(mypath->product_id, "HSG80 ", 16) == 0) { - get_storageworks_wwid(fd, mypath->wwid); - return 0; - } + int i; + static struct { + char * vendor; + char * product; + int (*getuid) (int fd, char * wwid); + } wlist[] = { + {"COMPAQ ", "HSV110 (C)COMPAQ", &get_evpd_wwid}, + {"COMPAQ ", "MSA1000 ", &get_evpd_wwid}, + {"COMPAQ ", "MSA1000 VOLUME ", &get_evpd_wwid}, + {"DEC ", "HSG80 ", &get_evpd_wwid}, + {"HP ", "HSV100 ", &get_evpd_wwid}, + {"HP ", "A6189A ", &get_evpd_wwid}, + {"HP ", "OPEN- ", &get_evpd_wwid}, + {"DDN ", "SAN DataDirector", &get_evpd_wwid}, + {"FSC ", "CentricStor ", &get_evpd_wwid}, + {"HITACHI ", "DF400 ", &get_evpd_wwid}, + {"HITACHI ", "DF500 ", &get_evpd_wwid}, + {"HITACHI ", "DF600 ", &get_evpd_wwid}, + {"IBM ", "ProFibre 4000R ", &get_evpd_wwid}, + {"SGI ", "TP9100 ", &get_evpd_wwid}, + {"SGI ", "TP9300 ", &get_evpd_wwid}, + {"SGI ", "TP9400 ", &get_evpd_wwid}, + {"SGI ", "TP9500 ", &get_evpd_wwid}, + {NULL, NULL, NULL}, + }; + for (i = 0; wlist[i].vendor; i++) { + if (strncmp(mypath->vendor_id, wlist[i].vendor, 8) == 0 && + strncmp(mypath->product_id, wlist[i].product, 16) == 0) { + wlist[i].getuid(fd, mypath->wwid); + return 0; + } + } return 1; } @@ -214,7 +244,7 @@ blacklist (char * dev) { }; for (i = 0; blist[i].lengh; i++) { - if (strncmp(dev, blist[i].headstr, blist[i].lengh)) + if (strncmp(dev, blist[i].headstr, blist[i].lengh) == 0) return 1; } return 0; @@ -562,6 +592,17 @@ add_map(struct env * conf, struct path * all_paths, int i, np; long size = -1; + /* defaults for multipath target */ + int dm_nr_path_args = 2; + int dm_path_test_int = 10; + char * dm_ps_name = "round-robin"; + int dm_ps_nr_args = 2; + int dm_path_failback_int = 10; + int dm_path_nr_fail = 2; + int dm_ps_prio = 1; + int dm_ps_min_io = 2; + + if (!(dmt = dm_task_create(op))) return 0; @@ -577,7 +618,14 @@ add_map(struct env * conf, struct path * all_paths, } if (np == 0) goto addout; - params_p += sprintf(params_p, "%i 32", np); + /* temporarily disable creation of single path maps */ + /* Sistina should modify the target limits */ + if (np < 2) + goto addout; + + params_p += sprintf(params_p, "%i %i %i %s %i", + np, dm_nr_path_args, dm_path_test_int, + dm_ps_name, dm_ps_nr_args); for (i=0; i<=mp[index].npaths; i++) { if (( 0 == all_paths[PINDEX(index,i)].state) || @@ -585,8 +633,10 @@ add_map(struct env * conf, struct path * all_paths, continue; if (size < 0) size = get_disk_size(conf, all_paths[PINDEX(index,0)].dev); - params_p += sprintf(params_p, " %s %i", - all_paths[PINDEX(index,i)].dev, 0); + params_p += sprintf(params_p, " %s %i %i %i %i", + all_paths[PINDEX(index,i)].dev, + dm_path_failback_int, dm_path_nr_fail, + dm_ps_prio, dm_ps_min_io); } if (size < 0)