multipath: check if a device belongs to multipath
authorBenjamin Marzinski <bmarzins@redhat.com>
Fri, 27 Jul 2012 20:55:24 +0000 (15:55 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Tue, 21 Aug 2012 17:39:26 +0000 (19:39 +0200)
commit374ad934a915767b1fee81a9362e3522833a5fa8
tree488c1bc785fbab9356507da1602598c55fd18738
parent47d818a43a1dca755129dff8b29539461a203ea8
multipath: check if a device belongs to multipath

This patch adds a new multipath option "-c", which checks if a device
belongs to multipath.  This can be done during the add uevent for the
device, before the multipath device has even been created.  This allows
udev to be able to handle multipath path devices differently.  To do
this multipath now keeps track of the wwids of all previously created
multipath devices in /etc/multipath/wwids. The file creating and
editting code from alias.[ch] has been split out into file.[ch]. When a
device is checked to see if it's a multipath path, it's wwid is
compared against the ones in the wwids file. Also, since the
uid_attribute may not have been added to the udev database entry for
the device if this is called in a udev rule, when using the "-c" option,
get_uid will now also check the process' envirionment variables for the
uid_attribute.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
libmultipath/Makefile
libmultipath/alias.c
libmultipath/alias.h
libmultipath/configure.c
libmultipath/defaults.h
libmultipath/discovery.c
libmultipath/file.c [new file with mode: 0644]
libmultipath/file.h [new file with mode: 0644]
libmultipath/wwids.c [new file with mode: 0644]
libmultipath/wwids.h [new file with mode: 0644]
multipath/main.c