[DRBD-cvs] svn commit by phil - r2957 - branches/drbd-8.0/drbd -
Simon: Allowes one to change the program that executes
drbd-cvs at lists.linbit.com
drbd-cvs at lists.linbit.com
Fri Jun 29 10:46:43 CEST 2007
Author: phil
Date: 2007-06-29 10:46:36 +0200 (Fri, 29 Jun 2007)
New Revision: 2957
Modified:
branches/drbd-8.0/drbd/drbd_int.h
branches/drbd-8.0/drbd/drbd_main.c
branches/drbd-8.0/drbd/drbd_nl.c
Log:
Simon: Allowes one to change the program that executes user mode helpers.
Modified: branches/drbd-8.0/drbd/drbd_int.h
===================================================================
--- branches/drbd-8.0/drbd/drbd_int.h 2007-06-27 12:40:51 UTC (rev 2956)
+++ branches/drbd-8.0/drbd/drbd_int.h 2007-06-29 08:46:36 UTC (rev 2957)
@@ -51,6 +51,8 @@
extern int fault_devs;
#endif
+extern char usermode_helper[];
+
#include <linux/major.h>
#ifdef DRBD_MAJOR
# warning "FIXME. DRBD_MAJOR is now officially defined in major.h"
Modified: branches/drbd-8.0/drbd/drbd_main.c
===================================================================
--- branches/drbd-8.0/drbd/drbd_main.c 2007-06-27 12:40:51 UTC (rev 2956)
+++ branches/drbd-8.0/drbd/drbd_main.c 2007-06-29 08:46:36 UTC (rev 2957)
@@ -119,6 +119,14 @@
module_param(trace_devs,int,0644);
#endif
+
+// Module parameter for setting the user mode helper program
+// to run. Default is /sbin/drbdadm
+
+char usermode_helper[80] = "/sbin/drbdadm";
+
+module_param_string(usermode_helper, usermode_helper, sizeof(usermode_helper), 0644);
+
// global panic flag
volatile int drbd_did_panic = 0;
Modified: branches/drbd-8.0/drbd/drbd_nl.c
===================================================================
--- branches/drbd-8.0/drbd/drbd_nl.c 2007-06-27 12:40:51 UTC (rev 2956)
+++ branches/drbd-8.0/drbd/drbd_nl.c 2007-06-29 08:46:36 UTC (rev 2957)
@@ -164,7 +164,7 @@
int drbd_khelper(drbd_dev *mdev, char* cmd)
{
char mb[12];
- char *argv[] = {"/sbin/drbdadm", cmd, mb, NULL };
+ char *argv[] = {usermode_helper, cmd, mb, NULL };
static char *envp[] = { "HOME=/",
"TERM=linux",
"PATH=/sbin:/usr/sbin:/bin:/usr/bin",
@@ -172,8 +172,10 @@
snprintf(mb,12,"minor-%d",mdev_to_minor(mdev));
+ INFO("helper command: %s %s\n",usermode_helper,cmd);
+
drbd_bcast_ev_helper(mdev,cmd);
- return call_usermodehelper("/sbin/drbdadm",argv,envp,1);
+ return call_usermodehelper(usermode_helper,argv,envp,1);
}
drbd_disks_t drbd_try_outdate_peer(drbd_dev *mdev)
More information about the drbd-cvs
mailing list