chiark / gitweb /
[PATCH] update extras/multipath
[elogind.git] / extras / multipath / main.c
index a8e29e8ba60e876e39c8ec9d882a91c0ce743ee6..d4dd89a3056b4529b22713cb1ad91784f5436ba4 100644 (file)
@@ -558,46 +558,6 @@ coalesce_paths(struct env * conf, struct multipath * mp,
        return nmp;
 }
 
-static int
-make_dm_node(char * str)
-{
-       int r = 0;
-       char buff[FILE_NAME_SIZE];
-       struct dm_names * names;
-        unsigned next = 0;
-       struct dm_task *dmt;
-
-       if (!(dmt = dm_task_create(DM_DEVICE_LIST)))
-               return 0;
-
-       if (!dm_task_run(dmt))
-               goto out;
-
-       if (!(names = dm_task_get_names(dmt)))
-               goto out;
-
-       if (!names->dev) {
-               r = 1;
-               goto out;
-       }
-
-        do {
-               if (0 == strcmp(names->name, str))
-                       break;
-                next = names->next;
-                names = (void *) names + next;
-        } while (next);
-
-       sprintf(buff, "/dev/mapper/%s", str);
-       unlink(buff);
-       mknod(buff, 0600 | S_IFBLK, names->dev);
-
-       out:
-       dm_task_destroy(dmt);
-       return r;
-
-}
-
 static int
 dm_simplecmd(int task, const char *name) {
        int r = 0;
@@ -665,7 +625,7 @@ setup_map(struct env * conf, struct path * all_paths,
 
        if (all_paths[PINDEX(index,0)].iopolicy == MULTIBUS &&
            !conf->forcedfailover ) {
-               params_p += sprintf(params_p, " %i %s %i %i",
+               params_p += sprintf(params_p, " %i %s %i %i",
                                    dm_pg_prio, dm_ps_name, np, dm_ps_nr_args);
                
                for (i=0; i<=mp[index].npaths; i++) {
@@ -678,6 +638,7 @@ setup_map(struct env * conf, struct path * all_paths,
 
        if (all_paths[PINDEX(index,0)].iopolicy == FAILOVER ||
            conf->forcedfailover) {
+               params_p += sprintf(params_p, " %i", mp[index].npaths + 1);
                for (i=0; i<=mp[index].npaths; i++) {
                        if (0 != all_paths[PINDEX(index,i)].sg_id.scsi_type)
                                continue;
@@ -710,7 +671,6 @@ setup_map(struct env * conf, struct path * all_paths,
        if (op == DM_DEVICE_RELOAD)
                dm_simplecmd(DM_DEVICE_RESUME, mp[index].wwid);
 
-       make_dm_node(mp[index].wwid);
        return 1;
 }