[dm-devel] [ANNOUNCE] multipath-tools-0.2.4

christophe.varoqui at free.fr christophe.varoqui at free.fr
Mon Jul 5 08:04:13 UTC 2004


> 
> Multipathd does not run, it creates the pid file then exits (unless it's a
> hidden process somehow).
> 
here is the proper fix, as it will be included in the next release :

--- multipath-tools-0.2.4/multipathd/main.c     2004-06-28 18:44:31.000000000 +0200
+++ multipath-tools-0.2.5/multipathd/main.c     2004-07-05 09:55:55.000000000 +0200
@@ -544,6 +544,68 @@
        return (failedpaths);
 }
 
+#define VECTOR_ADDSTR(a, b) \
+       str = zalloc (6 * sizeof(char)); \
+       sprintf (str, b); \
+       vector_alloc_slot(a); \
+       vector_set_slot(a, str);
+
+static void
+setup_default_blist (vector blist)
+{
+       char * str;
+
+       VECTOR_ADDSTR(blist, "cciss");
+       VECTOR_ADDSTR(blist, "fd");
+       VECTOR_ADDSTR(blist, "hd");
+       VECTOR_ADDSTR(blist, "md");
+       VECTOR_ADDSTR(blist, "dm");
+       VECTOR_ADDSTR(blist, "sr");
+       VECTOR_ADDSTR(blist, "scd");
+       VECTOR_ADDSTR(blist, "st");
+       VECTOR_ADDSTR(blist, "ram");
+       VECTOR_ADDSTR(blist, "raw");
+       VECTOR_ADDSTR(blist, "loop");
+}
+
+#define VECTOR_ADDHWE(a, b, c, d) \
+       hwe = zalloc (sizeof(struct hwentry)); \
+       hwe->vendor = zalloc (9 * sizeof(char)); \
+       sprintf (hwe->vendor, b); \
+       hwe->product = zalloc (17 * sizeof(char)); \
+       sprintf (hwe->product, c); \
+       hwe->checker_index = d; \
+       vector_alloc_slot(a); \
+       vector_set_slot(a, hwe);
+
+static void
+setup_default_hwtable (vector hwtable)
+{
+       struct hwentry * hwe;
+
+       VECTOR_ADDHWE(hwtable, "COMPAQ", "HSV110 (C)COMPAQ", 0);
+       VECTOR_ADDHWE(hwtable, "COMPAQ", "MSA1000", 0);
+       VECTOR_ADDHWE(hwtable, "COMPAQ", "MSA1000 VOLUME", 0);
+       VECTOR_ADDHWE(hwtable, "DEC", "HSG80", 0);
+       VECTOR_ADDHWE(hwtable, "HP", "HSV110", 0);
+       VECTOR_ADDHWE(hwtable, "HP", "A6189A", 0);
+       VECTOR_ADDHWE(hwtable, "HP", "OPEN-", 0);
+       VECTOR_ADDHWE(hwtable, "DDN", "SAN DataDirector", 0);
+       VECTOR_ADDHWE(hwtable, "FSC", "CentricStor", 0);
+       VECTOR_ADDHWE(hwtable, "HITACHI", "DF400", 0);
+       VECTOR_ADDHWE(hwtable, "HITACHI", "DF500", 0);
+       VECTOR_ADDHWE(hwtable, "HITACHI", "DF600", 0);
+       VECTOR_ADDHWE(hwtable, "IBM", "ProFibre 4000R", 0);
+       VECTOR_ADDHWE(hwtable, "SGI", "TP9100", 0);
+       VECTOR_ADDHWE(hwtable, "SGI", "TP9300", 0);
+       VECTOR_ADDHWE(hwtable, "SGI", "TP9400", 0);
+       VECTOR_ADDHWE(hwtable, "SGI", "TP9500", 0);
+       VECTOR_ADDHWE(hwtable, "3PARdata", "VV", 0);
+       VECTOR_ADDHWE(hwtable, "STK", "OPENstorage D280", 0);
+       VECTOR_ADDHWE(hwtable, "SUN", "StorEdge 3510", 0);
+       VECTOR_ADDHWE(hwtable, "SUN", "T4", 0);
+}
+
 void pidfile (pid_t pid)
 {
        FILE *file;
@@ -626,7 +688,7 @@
        struct paths *failedpaths;
        pid_t pid;
 
-       pid = fork ();
+       pid = fork();
 
        /* can't fork */
        if (pid < 0)
@@ -634,28 +696,39 @@
 
        /* let the parent die happy */
        if (pid > 0)
-               exit (0);
+               exit(0);
 
        /* child's play */
-       openlog (argv[0], 0, LOG_DAEMON);
-       LOG (1, "--------start up--------");
+       openlog(argv[0], 0, LOG_DAEMON);
+       LOG(1, "--------start up--------");
 
-       pidfile (pid);
-       signal_init ();
+       pidfile(pid);
+       signal_init();
 
-       failedpaths = initpaths ();
+       failedpaths = initpaths();
 
-       LOG (2, "read " CONFIGFILE);
+       LOG(2, "read " CONFIGFILE);
        init_data(CONFIGFILE, init_keywords);
 
+       /* fill the voids left in the config file */
+       if (hwtable == NULL) {
+               hwtable = vector_alloc();
+               setup_default_hwtable(hwtable);
+       }
+
+       if (blist == NULL) {
+               blist = vector_alloc();
+               setup_default_blist(blist);
+       }



More information about the dm-devel mailing list