* multipath-tools/libmultipath callout.c
@ 2011-10-24 13:39 bmarzins
0 siblings, 0 replies; only message in thread
From: bmarzins @ 2011-10-24 13:39 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2011-10-24 13:39:56
Modified files:
libmultipath : callout.c
Log message:
Fix for bz #729478. Add a new callout format parameter %c, that converts the "!"
in cciss device names to "/".
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/callout.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.2.2&r2=1.5.2.3
--- multipath-tools/libmultipath/callout.c 2009/05/15 21:01:26 1.5.2.2
+++ multipath-tools/libmultipath/callout.c 2011/10/24 13:39:56 1.5.2.3
@@ -133,6 +133,19 @@
return retval;
}
+void
+convert_cciss(char *dest, char *src)
+{
+ char *ptr;
+
+ strcpy(dest, src);
+ if (strncmp(src, "cciss", 5))
+ return;
+ ptr = strrchr(dest, '!');
+ if (ptr)
+ *ptr = '/';
+}
+
extern int
apply_format (char * string, char * cmd, struct path * pp)
{
@@ -141,6 +154,7 @@
char * p;
int len;
int myfree;
+ char converted_dev[FILE_NAME_SIZE];
if (!string)
return 1;
@@ -179,6 +193,17 @@
snprintf(p, len, "%s", pp->dev);
p += len - 1;
break;
+ case 'c':
+ convert_cciss(converted_dev, pp->dev);
+ len = strlen(converted_dev) + 1;
+ myfree -= len;
+
+ if (myfree < 2)
+ return 1;
+
+ snprintf(p, len, "%s", converted_dev);
+ p += len - 1;
+ break;
case 'd':
len = strlen(pp->dev_t) + 1;
myfree -= len;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-10-24 13:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-24 13:39 multipath-tools/libmultipath callout.c bmarzins
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.