diff -urN multipath-0.0.18.0/ChangeLog multipath-0.0.18.2/ChangeLog --- multipath-0.0.18.0/ChangeLog 2004-02-19 19:38:36.000000000 +0100 +++ multipath-0.0.18.2/ChangeLog 2004-02-22 14:12:13.000000000 +0100 @@ -1,3 +1,13 @@ +2004-02-21 multipath-018 + * From the Debian SID inclusion review (Philipp Matthias Hahn) + * use DESTDIR install prefix in the Makefile + * add man pages for devmap_name & multipath + * correct libsysfs.h includes + * fork the hotplug script in its own shell + * Sync with the kernel device mapper code as of 2.6.3-udm3 + ie. Remove the test interval parameter and its uses + * Remove superfluous scsi parameter passed from hotplug + * Add the man pages to the [un]install targets 2004-02-17 multipath-017 * remove the restrictive -f flag. Introduce a more generic "-m iopolicy" one. diff -urN multipath-0.0.18.0/Makefile multipath-0.0.18.2/Makefile --- multipath-0.0.18.0/Makefile 2004-02-19 19:38:35.000000000 +0100 +++ multipath-0.0.18.2/Makefile 2004-02-22 14:24:33.000000000 +0100 @@ -10,8 +10,11 @@ udevdir = ../.. klibcdir = $(udevdir)/klibc sysfsdir = $(udevdir)/libsysfs +mandir = /usr/share/man/man8 CC = gcc +GZIP = /bin/gzip -c + GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"} KERNEL_DIR = /lib/modules/${shell uname -r}/build CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \ @@ -45,26 +48,33 @@ $(EXEC): $(OBJS) $(LD) -o $(EXEC) $(CRT0) $(OBJS) $(SYSFSOBJS) $(DMOBJS) $(LIB) $(LIBGCC) strip $(EXEC) + $(GZIP) $(EXEC).8 > $(EXEC).8.gz devmap_name: devmap_name.o $(LD) -o devmap_name $(CRT0) devmap_name.o $(DMOBJS) $(LIB) $(LIBGCC) strip devmap_name + $(GZIP) devmap_name.8 > devmap_name.8.gz clean: - rm -f core *.o $(EXEC) devmap_name + rm -f core *.o $(EXEC) devmap_name *.gz $(MAKE) -C libdevmapper clean install: - install -d $(bindir) - install -m 755 $(EXEC) $(bindir)/ - install -m 755 devmap_name $(bindir)/ - install -d /etc/hotplug.d/scsi/ - install -m 755 multipath.hotplug /etc/hotplug.d/scsi/ + install -d $(DESTDIR)$(bindir) + install -m 755 $(EXEC) $(DESTDIR)$(bindir)/ + install -m 755 devmap_name $(DESTDIR)$(bindir)/ + install -d $(DESTDIR)/etc/hotplug.d/scsi/ + install -m 755 multipath.hotplug $(DESTDIR)/etc/hotplug.d/scsi/ + install -d $(DESTDIR)$(mandir) + install -m 644 devmap_name.8.gz $(DESTDIR)$(mandir) + install -m 644 multipath.8.gz $(DESTDIR)$(mandir) uninstall: - rm /etc/hotplug.d/scsi/multipath.hotplug - rm $(bindir)/$(EXEC) - rm $(bindir)/devmap_name + rm $(DESTDIR)/etc/hotplug.d/scsi/multipath.hotplug + rm $(DESTDIR)$(bindir)/$(EXEC) + rm $(DESTDIR)$(bindir)/devmap_name + rm $(DESTDIR)$(mandir)/devmap_name.8.gz + rm $(DESTDIR)$(mandir)/multipath.8.gz # Code dependencies main.o: main.c main.h sg_include.h devinfo.h diff -urN multipath-0.0.18.0/devinfo.c multipath-0.0.18.2/devinfo.c --- multipath-0.0.18.0/devinfo.c 2004-02-19 19:38:36.000000000 +0100 +++ multipath-0.0.18.2/devinfo.c 2004-02-22 13:00:22.000000000 +0100 @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include "devinfo.h" #include "sg_include.h" diff -urN multipath-0.0.18.0/devmap_name.8 multipath-0.0.18.2/devmap_name.8 --- multipath-0.0.18.0/devmap_name.8 1970-01-01 01:00:00.000000000 +0100 +++ multipath-0.0.18.2/devmap_name.8 2004-02-22 14:23:39.000000000 +0100 @@ -0,0 +1,30 @@ +.TH DEVMAP_NAME 8 "February 2004" "" "Linux Administrator's Manual" +.SH NAME +devmap_name \- Query device-mapper name +.SH SYNOPSIS +.BI devmap_name " major minor" +.SH DESCRIPTION +.B devmap_name +queries the device-mapper for the name for the device +specified by +.I major +and +.I minor +number. +.br +.B devmap_name +can be called from +.B udev +by the following rule in +.IR /etc/udev/udev.rules : +.sp +.nf +KERNEL="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", \\ + NAME="%k", SYMLINK="%c" +.fi +.SH "SEE ALSO" +.BR udev (8), +.BR dmsetup (8) +.SH AUTHORS +.B devmap_name +was developed by Christophe Varoqui, and others. diff -urN multipath-0.0.18.0/main.c multipath-0.0.18.2/main.c --- multipath-0.0.18.0/main.c 2004-02-19 19:38:36.000000000 +0100 +++ multipath-0.0.18.2/main.c 2004-02-22 14:09:38.000000000 +0100 @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include "libdevmapper/libdevmapper.h" #include "main.h" #include "devinfo.h" @@ -110,7 +110,7 @@ char path[FILE_NAME_SIZE]; struct path curpath; - /* if called from hotplug, only consider the paths that relate to */ + /* if called from hotplug, only consider the paths that relate */ /* to the device pointed by conf.hotplugdev */ memset(empty_buff, 0, WWID_SIZE); memset(refwwid, 0, WWID_SIZE); @@ -442,6 +442,7 @@ path_count, path_buff); } sprintf(str, " %i%s", pg_count, pg_buff); + free(bitmap); } static int @@ -507,8 +508,6 @@ if (np < 1) return 0; - params_p += sprintf(params_p, "%i", conf->dm_path_test_int); - if ((all_paths[PINDEX(index,0)].iopolicy == MULTIBUS && conf->iopolicy == -1) || conf->iopolicy == MULTIBUS) { params_p += sprintf(params_p, " 1 %i %s %i %i", @@ -602,18 +601,20 @@ usage(char * progname) { fprintf(stderr, VERSION_STRING); - fprintf(stderr, "Usage: %s [-v|-q] [-d] [-i int] [-m max_devs] ", + fprintf(stderr, "Usage: %s [-v|-q] [-d] [-m max_devs] [device]", progname); fprintf(stderr, "[-p failover|multibus|group_by_serial]\n"); fprintf(stderr, "\t-v\t\tverbose, print all paths and multipaths\n"); fprintf(stderr, "\t-q\t\tquiet, no output at all\n"); fprintf(stderr, "\t-d\t\tdry run, do not create or update devmaps\n"); - fprintf(stderr, "\t-i\t\tmultipath target param : polling interval\n"); fprintf(stderr, "\t-m max_devs\tscan {max_devs} devices at most\n"); fprintf(stderr, "\t-p policy\tforce maps to specified policy :\n"); fprintf(stderr, "\t\t\tfailover\t1 path per priority group\n"); fprintf(stderr, "\t\t\tmultibus\tall paths in 1 priority group\n"); fprintf(stderr, "\t\t\tgroup_by_serial\t1 priority group per serial\n"); + fprintf(stderr, "\tdevice\t\tlimit scope to the multipath including the specified device\n"); + fprintf(stderr, "\t\t\tdevice is relative to the sysfs mountpoint, in the devices hierarchy\n"); + fprintf(stderr, "\t\t\t(hotplug-style reference)\n"); exit(1); } @@ -632,7 +633,6 @@ conf.verbose = 0; /* 1 == Print all_paths and mp */ conf.quiet = 0; /* 1 == Do not even print devmaps */ conf.iopolicy = -1; /* Apply the defaults in get_unique_id() */ - conf.dm_path_test_int = 10; for (i = 1; i < argc; ++i) { if (0 == strcmp("-v", argv[i])) { @@ -649,8 +649,6 @@ conf.quiet = 1; } else if (0 == strcmp("-d", argv[i])) conf.dry_run = 1; - else if (0 == strcmp("-i", argv[i])) - conf.dm_path_test_int = atoi(argv[++i]); else if (0 == strcmp("-p", argv[i++])) { if (!strcmp(argv[i], "failover")) conf.iopolicy = FAILOVER; @@ -658,8 +656,8 @@ conf.iopolicy = MULTIBUS; if (!strcmp(argv[i], "group_by_serial")) conf.iopolicy = GROUP_BY_SERIAL; - } else if (0 == strcmp("scsi", argv[i])) - strcpy(conf.hotplugdev, argv[++i]); + } else if (0 == strncmp("/devices", argv[i], 8)) + strcpy(conf.hotplugdev, argv[i]); else if (*argv[i] == '-') { fprintf(stderr, "Unknown switch: %s\n", argv[i]); usage(argv[0]); diff -urN multipath-0.0.18.0/main.h multipath-0.0.18.2/main.h --- multipath-0.0.18.0/main.h 2004-02-19 19:38:35.000000000 +0100 +++ multipath-0.0.18.2/main.h 2004-02-22 13:14:50.000000000 +0100 @@ -102,7 +102,6 @@ int dry_run; int iopolicy; int with_sysfs; - int dm_path_test_int; char sysfs_path[FILE_NAME_SIZE]; char hotplugdev[FILE_NAME_SIZE]; }; diff -urN multipath-0.0.18.0/multipath.8 multipath-0.0.18.2/multipath.8 --- multipath-0.0.18.0/multipath.8 1970-01-01 01:00:00.000000000 +0100 +++ multipath-0.0.18.2/multipath.8 2004-02-22 13:06:19.000000000 +0100 @@ -0,0 +1,54 @@ +.TH MULTIPATH 8 "February 2004" "" "Linux Administrator's Manual" +.SH NAME +multipath \- Device mapper target autoconfig +.SH SYNOPSIS +.B multipath +.RB [\| \-v | \-q \|] +.RB [\| \-d \|] +.RB [\| \-i\ \c +.IR int \|] +.RB [\| \-m\ \c +.IR max_devs \|] +.RB [\| \-p\ \c +.BR failover | multibus | group_by_serial \|] +.SH DESCRIPTION +.B multipath +is used to detect multiple paths to devices for fail-over or performance reasons and coalesces them. +.SH OPTIONS +.TP +.B \-v +verbose, print all paths and multipaths +.TP +.B \-q +quiet, no output at all +.TP +.B \-d +dry run, do not create or update devmaps +.TP +.BI \-i " int" +multipath target param: polling interval +.TP +.BI \-m " max_devs" +scan +.I max_devs +devices at most +.TP +.BI \-p " policy" +force maps to specified policy: +.RS 1.2i +.TP 1.2i +.B failover +1 path per priority group +.TP +.B multibus +all paths in 1 priority group +.TP +.B group_by_serial +1 priority group per serial +.RE +.SH "SEE ALSO" +.BR udev (8), +.BR dmsetup (8) +.SH AUTHORS +.B multipath +was developed by Christophe Varoqui, and others. diff -urN multipath-0.0.18.0/multipath.hotplug multipath-0.0.18.2/multipath.hotplug --- multipath-0.0.18.0/multipath.hotplug 2004-02-19 19:38:35.000000000 +0100 +++ multipath-0.0.18.2/multipath.hotplug 2004-02-22 13:58:03.000000000 +0100 @@ -1,6 +1,7 @@ +#!bin/sh . /etc/hotplug/hotplug.functions # wait for sysfs sleep 1 -mesg `/sbin/multipath scsi $DEVPATH` +mesg `/sbin/multipath $DEVPATH`