From: Benjamin Marzinski Date: Fri, 27 Jul 2012 20:57:18 +0000 (-0500) Subject: multipath: fix cciss device names X-Git-Tag: upstream/0.5.0~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=566fbaaed0b35ba5a71100ecd964a84e1fd633d7;p=platform%2Fupstream%2Fmultipath-tools.git multipath: fix cciss device names When we're looking for cciss devices in sysfs, they have a "!" not a "/". If users run multipath on a cciss device using it's devnode name, /dev/cciss/cXdY, multipath should convert that to the sysfs name. Signed-off-by: Benjamin Marzinski --- diff --git a/multipath/main.c b/multipath/main.c index 9ea2ae3..628da6b 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -393,6 +393,16 @@ get_dev_type(char *dev) { return DEV_DEVMAP; } +static void +convert_dev(char *dev) +{ + char *ptr = strstr(dev, "cciss/"); + if (ptr) { + ptr += 5; + *ptr = '!'; + } +} + int main (int argc, char *argv[]) { @@ -494,6 +504,8 @@ main (int argc, char *argv[]) strncpy(conf->dev, argv[optind], FILE_NAME_SIZE); conf->dev_type = get_dev_type(conf->dev); + if (conf->dev_type == DEV_DEVNODE) + convert_dev(conf->dev); } conf->daemon = 0;