From d80f9a107fc869d541a36c8c9d12c32589c34c12 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 18 Jan 2017 09:53:46 +0100 Subject: [PATCH] lvmcmd2lib: support new command Internal command which reads lvm.conf settins and passes it via envvar to dmeventd monitoring thread. --- WHATS_NEW | 1 + tools/lvmcmdlib.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index e5b735fdf..94411ae08 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.169 - ===================================== + Support new internal command _dmeventd_thin_command. Introduce new dmeventd/thin_command configurable setting. Use new default units 'r' for displaying sizes. Also unmount mount point on top of MD device if using blkdeactivate -u. diff --git a/tools/lvmcmdlib.c b/tools/lvmcmdlib.c index 276c8b357..024376826 100644 --- a/tools/lvmcmdlib.c +++ b/tools/lvmcmdlib.c @@ -83,7 +83,10 @@ int lvm2_run(void *handle, const char *cmdline) memlock_inc_daemon(cmd); } else if (!strcmp(cmdline, "_memlock_dec")) memlock_dec_daemon(cmd); - else + else if (!strcmp(cmdline, "_dmeventd_thin_command")) { + if (setenv(cmdline, find_config_tree_str(cmd, dmeventd_thin_command_CFG, NULL), 1)) + ret = ECMD_FAILED; + } else ret = lvm_run_command(cmd, argc, argv); out: