summaryrefslogtreecommitdiffstats
path: root/tools/dmsetup.c
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2010-01-11 15:36:24 +0000
committerPeter Rajnoha <prajnoha@redhat.com>2010-01-11 15:36:24 +0000
commitd2b43c4b340bf5741bad429068ba9ef791330ec4 (patch)
treefd74edf69ca736b461c30305cf56b8c77aef642e /tools/dmsetup.c
parentb422bb2187cbf760530305e1de13b424cf4dabc7 (diff)
downloadlvm2-d2b43c4b340bf5741bad429068ba9ef791330ec4.tar.gz
lvm2-d2b43c4b340bf5741bad429068ba9ef791330ec4.tar.xz
lvm2-d2b43c4b340bf5741bad429068ba9ef791330ec4.zip
Add support to disable udev checking: DM_UDEV_DISABLE_CHECKING=1 env. variable.
Sometimes it is really needed to switch off udev checking and the warnings we show when we detect that udev has not done its job right - the messages like "Udev should have done this and that. Falling back to direct node creation/removal. " etc. This would be especially handy while setting DM_DEV_DIR env var that could be set to a different location than standard /dev (udev can't create nodes/symlinks out of that one directory that is configured into udevd). The exact same situation happens while we're running our tests.
Diffstat (limited to 'tools/dmsetup.c')
-rw-r--r--tools/dmsetup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index d81032b5..d62e1471 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -3158,6 +3158,7 @@ int main(int argc, char **argv)
struct command *c;
int r = 1;
const char *dev_dir;
+ const char *disable_udev_checking;
(void) setlocale(LC_ALL, "");
@@ -3207,6 +3208,11 @@ int main(int argc, char **argv)
if (_switches[NOUDEVSYNC_ARG])
dm_udev_set_sync_support(0);
+ disable_udev_checking = getenv("DM_UDEV_DISABLE_CHECKING");
+ if ((disable_udev_checking && *disable_udev_checking) &&
+ !strcmp(disable_udev_checking, "1"))
+ dm_udev_set_checking(0);
+
doit:
if (!c->fn(argc, argv, NULL)) {
fprintf(stderr, "Command failed\n");