FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 07-27-2012, 08:57 PM
Benjamin Marzinski
 
Default 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 <bmarzins@redhat.com>
---
multipath/main.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

Index: multipath-tools-120518/multipath/main.c
================================================== =================
--- multipath-tools-120518.orig/multipath/main.c
+++ multipath-tools-120518/multipath/main.c
@@ -409,6 +409,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[])
{
@@ -514,6 +524,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;


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 08-17-2012, 07:57 PM
Christophe Varoqui
 
Default multipath: fix cciss device names

On ven., 2012-07-27 at 15:57 -0500, Benjamin Marzinski wrote:
> 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.
>
Applied.

Thanks.

> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
> multipath/main.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> Index: multipath-tools-120518/multipath/main.c
> ================================================== =================
> --- multipath-tools-120518.orig/multipath/main.c
> +++ multipath-tools-120518/multipath/main.c
> @@ -409,6 +409,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[])
> {
> @@ -514,6 +524,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;
>



--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 12:17 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org