All of lore.kernel.org
 help / color / mirror / Atom feed
From: prajnoha@sourceware.org <prajnoha@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW_DM libdm/libdevmapper.h libdm ...
Date: 15 Feb 2012 12:23:17 -0000	[thread overview]
Message-ID: <20120215122317.20889.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha at sourceware.org	2012-02-15 12:23:16

Modified files:
	.              : WHATS_NEW_DM 
	libdm          : libdevmapper.h libdm-common.c libdm-common.h 

Log message:
	Add DM_DEFAULT_NAME_MANGLING_MODE env. variable to override configured value.
	
	Just in case of emergency when name mangling code causes any problems so
	we can override the default value and switch off the mangling globally.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.564&r2=1.565
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.182&r2=1.183
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-common.c.diff?cvsroot=lvm2&r1=1.140&r2=1.141
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-common.h.diff?cvsroot=lvm2&r1=1.13&r2=1.14

--- LVM2/WHATS_NEW_DM	2012/02/15 12:17:34	1.564
+++ LVM2/WHATS_NEW_DM	2012/02/15 12:23:15	1.565
@@ -1,5 +1,7 @@
 Version 1.02.71 - 
 ====================================
+  Add DM_DEFAULT_NAME_MANGLING_MODE env. variable to override configured value.
+  Add dm_lib_init to automatically initialise device-mapper library on load.
   Replace any '\' char with '\\' in table specification on input.
   Add mangle command to dmsetup to provide renaming to correct mangled form.
   Add 'mangled_name' and 'unmangled_name' fields to dmsetup info -c -o.
--- LVM2/libdm/libdevmapper.h	2012/02/15 12:01:28	1.182
+++ LVM2/libdm/libdevmapper.h	2012/02/15 12:23:16	1.183
@@ -365,6 +365,12 @@
  */
 int dm_device_has_mounted_fs(uint32_t major, uint32_t minor);
 
+
+/*
+ * Initialise library
+ */
+void dm_lib_init(void) __attribute__((constructor));
+
 /*
  * Release library resources
  */
--- LVM2/libdm/libdm-common.c	2012/02/15 11:39:38	1.140
+++ LVM2/libdm/libdm-common.c	2012/02/15 12:23:16	1.141
@@ -43,6 +43,8 @@
 #  include <selinux/label.h>
 #endif
 
+#define DM_DEFAULT_NAME_MANGLING_MODE_ENV_VAR_NAME "DM_DEFAULT_NAME_MANGLING_MODE"
+
 #define DEV_DIR "/dev/"
 
 #ifdef UDEV_SYNC_SUPPORT
@@ -66,7 +68,7 @@
 
 static int _verbose = 0;
 static int _suspended_dev_counter = 0;
-static int _name_mangling_mode = DEFAULT_DM_NAME_MANGLING;
+static int _name_mangling_mode = -1;
 
 #ifdef HAVE_SELINUX_LABEL_H
 static struct selabel_handle *_selabel_handle = NULL;
@@ -79,6 +81,22 @@
 static int _udev_checking = 1;
 #endif
 
+void dm_lib_init(void)
+{
+	const char *env;
+
+	env = getenv(DM_DEFAULT_NAME_MANGLING_MODE_ENV_VAR_NAME);
+	if (env && *env) {
+		if (!strcasecmp(env, "none"))
+			_name_mangling_mode = DM_STRING_MANGLING_NONE;
+		else if (!strcasecmp(env, "auto"))
+			_name_mangling_mode = DM_STRING_MANGLING_AUTO;
+		else if (!strcasecmp(env, "hex"))
+			_name_mangling_mode = DM_STRING_MANGLING_HEX;
+	} else
+		_name_mangling_mode = DEFAULT_DM_NAME_MANGLING;
+}
+
 /*
  * Library users can provide their own logging
  * function.
--- LVM2/libdm/libdm-common.h	2012/02/15 11:39:38	1.13
+++ LVM2/libdm/libdm-common.h	2012/02/15 12:23:16	1.14
@@ -18,6 +18,8 @@
 
 #include "libdevmapper.h"
 
+#define DM_DEFAULT_NAME_MANGLING_MODE_ENV_VAR_NAME "DM_DEFAULT_NAME_MANGLING_MODE"
+
 #define DEV_NAME(dmt) (dmt->mangled_dev_name ? : dmt->dev_name)
 
 int mangle_name(const char *str, size_t len, char *buf,



             reply	other threads:[~2012-02-15 12:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-15 12:23 prajnoha [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-02 17:31 LVM2 ./WHATS_NEW_DM libdm/libdevmapper.h libdm zkabelac
2012-02-23 22:45 zkabelac
2012-02-15 11:39 prajnoha
2012-02-15 11:27 prajnoha
2012-01-11 12:34 prajnoha
2011-12-21 12:47 zkabelac
2011-09-29  8:53 zkabelac
2011-09-22 17:36 prajnoha
2011-09-22 17:23 prajnoha
2011-09-22 17:17 prajnoha
2011-09-22 17:09 prajnoha
2011-08-19 16:26 agk
2011-03-10 12:48 zkabelac
2011-02-18 14:38 zkabelac
2011-02-04 16:08 mbroz
2011-01-04 14:43 prajnoha
2010-10-25 13:13 zkabelac
2010-10-15  1:10 agk
2010-04-28 13:37 prajnoha
2009-11-13 12:43 prajnoha
2009-10-22 12:55 prajnoha
2009-06-03 11:40 agk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120215122317.20889.qmail@sourceware.org \
    --to=prajnoha@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.