main - fix segfault handling duplicate PVs
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c38473548e546c8e94d...
Commit: c38473548e546c8e94d41587714f350a11362c84
Parent: e88163ceac0ca7d78ab728867a6e84d0e535ad1d
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Oct 14 14:02:59 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Oct 14 14:02:59 2021 -0500
fix segfault handling duplicate PVs
cmd arg was missing when switching to use an alternative
duplicate dev.
---
lib/cache/lvmcache.c | 2 +-
lib/label/label.c | 4 ++--
lib/label/label.h | 2 +-
tools/toollib.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index 2c4254324..bee63ebb4 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1349,7 +1349,7 @@ int lvmcache_label_scan(struct cmd_context *cmd)
dm_list_iterate_items(devl, &add_cache_devs) {
log_debug_cache("Adding chosen duplicate %s", dev_name(devl->dev));
- label_scan_dev(devl->dev);
+ label_scan_dev(cmd, devl->dev);
}
dm_list_splice(&_unused_duplicates, &del_cache_devs);
diff --git a/lib/label/label.c b/lib/label/label.c
index b8f0dc84d..3cd912270 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -1488,7 +1488,7 @@ void label_scan_destroy(struct cmd_context *cmd)
* device, this is not a commonly used function.
*/
-int label_scan_dev(struct device *dev)
+int label_scan_dev(struct cmd_context *cmd, struct device *dev)
{
struct dm_list one_dev;
struct device_list *devl;
@@ -1503,7 +1503,7 @@ int label_scan_dev(struct device *dev)
label_scan_invalidate(dev);
- _scan_list(NULL, NULL, &one_dev, 0, &failed);
+ _scan_list(cmd, NULL, &one_dev, 0, &failed);
free(devl);
diff --git a/lib/label/label.h b/lib/label/label.h
index 32ceebc34..8b510eb79 100644
--- a/lib/label/label.h
+++ b/lib/label/label.h
@@ -107,7 +107,7 @@ int label_scan_devs(struct cmd_context *cmd, struct dev_filter *f, struct dm_lis
int label_scan_devs_cached(struct cmd_context *cmd, struct dev_filter *f, struct dm_list *devs);
int label_scan_devs_rw(struct cmd_context *cmd, struct dev_filter *f, struct dm_list *devs);
int label_scan_devs_excl(struct cmd_context *cmd, struct dev_filter *f, struct dm_list *devs);
-int label_scan_dev(struct device *dev);
+int label_scan_dev(struct cmd_context *cmd, struct device *dev);
void label_scan_invalidate(struct device *dev);
void label_scan_invalidate_lv(struct cmd_context *cmd, struct logical_volume *lv);
void label_scan_drop(struct cmd_context *cmd);
diff --git a/tools/toollib.c b/tools/toollib.c
index c05a973d5..5b67669e1 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1481,7 +1481,7 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv,
/*
* add info to lvmcache from the duplicate dev.
*/
- label_scan_dev(devl->dev);
+ label_scan_dev(cmd, devl->dev);
/*
* the info/label should now be found because
2 years, 6 months
main - fix lvmcache_add log_debug pvid
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e88163ceac0ca7d78ab...
Commit: e88163ceac0ca7d78ab728867a6e84d0e535ad1d
Parent: 6fb497ef42a5f8324a90cb93734cd8071ed0dc0b
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Oct 13 16:26:00 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Oct 13 17:30:21 2021 -0500
fix lvmcache_add log_debug pvid
from previous cleanup
---
lib/cache/lvmcache.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index e04f00f2d..2c4254324 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -2168,15 +2168,17 @@ struct lvmcache_info *lvmcache_add(struct cmd_context *cmd, struct labeller *lab
{
const char *pvid = pvid_arg;
const char *vgid = vgid_arg;
- char pvid_dashed[64] __attribute__((aligned(8)));
struct lvmcache_vgsummary vgsummary = { 0 };
struct lvmcache_info *info;
struct lvmcache_info *info_lookup;
struct device_list *devl;
int created = 0;
- if (!id_write_format((const struct id *)&pvid, pvid_dashed, sizeof(pvid_dashed)))
- stack;
+ /*
+ * Note: ensure that callers of lvmcache_add() pass null terminated
+ * pvid and vgid strings, and do not pass char* that is type cast
+ * from struct id.
+ */
log_debug_cache("Found PVID %s on %s", pvid, dev_name(dev));
@@ -2206,7 +2208,7 @@ struct lvmcache_info *lvmcache_add(struct cmd_context *cmd, struct labeller *lab
if (!created) {
if (info->dev != dev) {
log_debug_cache("Saving initial duplicate device %s previously seen on %s with PVID %s.",
- dev_name(dev), dev_name(info->dev), pvid_dashed);
+ dev_name(dev), dev_name(info->dev), pvid);
memset(&dev->pvid, 0, sizeof(dev->pvid));
memcpy(dev->pvid, pvid, ID_LEN);
2 years, 6 months
main - toollib: remove all devices list from process_each_pv
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6fb497ef42a5f8324a9...
Commit: 6fb497ef42a5f8324a90cb93734cd8071ed0dc0b
Parent: 272d1ccac8654c0d74ecf255d13de0a6222ff96f
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Oct 13 14:13:54 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Oct 13 17:29:32 2021 -0500
toollib: remove all devices list from process_each_pv
Reporting non-PVs / "all devices" is only done by
pvs -a or pvdisplay -a, so avoid the work managing
a list of all devices in process_each_pv.
In the case when it's needed, use the results of
label_scan which already determines which devs
are not PVs.
---
lib/device/device.h | 1 +
lib/label/label.c | 1 +
tools/toollib.c | 253 ++++++++++++++--------------------------------------
3 files changed, 71 insertions(+), 184 deletions(-)
diff --git a/lib/device/device.h b/lib/device/device.h
index a30a1288b..9e471a9b5 100644
--- a/lib/device/device.h
+++ b/lib/device/device.h
@@ -39,6 +39,7 @@
#define DEV_IS_MD_COMPONENT 0x00020000 /* device is an md component */
#define DEV_IS_NVME 0x00040000 /* set if dev is nvme */
#define DEV_MATCHED_USE_ID 0x00080000 /* matched an entry from cmd->use_devices */
+#define DEV_SCAN_FOUND_NOLABEL 0x00100000 /* label_scan read, passed filters, but no lvm label */
/*
* Support for external device info.
diff --git a/lib/label/label.c b/lib/label/label.c
index b5804c738..b8f0dc84d 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -403,6 +403,7 @@ static int _process_block(struct cmd_context *cmd, struct dev_filter *f,
memset(dev->pvid, 0, sizeof(dev->pvid));
}
+ dev->flags |= DEV_SCAN_FOUND_NOLABEL;
*is_lvm_device = 0;
goto out;
}
diff --git a/tools/toollib.c b/tools/toollib.c
index 3682dfa0a..c05a973d5 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -3882,63 +3882,6 @@ static int _get_arg_devices(struct cmd_context *cmd,
return ret_max;
}
-static int _get_all_devices(struct cmd_context *cmd,
- int process_all_devices,
- struct dm_list *all_devices)
-{
- struct dev_iter *iter;
- struct device *dev;
- struct device_id_list *dil;
- struct hint *hint;
- int r = ECMD_FAILED;
-
- /*
- * If command is using hints and is only looking for PVs
- * (not all devices), then we can use only devs from hints.
- */
- if (!process_all_devices && !dm_list_empty(&cmd->hints)) {
- log_debug("Getting list of all devices from hints");
-
- dm_list_iterate_items(hint, &cmd->hints) {
- if (!(dev = dev_cache_get(cmd, hint->name, NULL)))
- continue;
-
- if (!(dil = dm_pool_zalloc(cmd->mem, sizeof(*dil)))) {
- log_error("device_id_list alloc failed.");
- return ECMD_FAILED;
- }
-
- memcpy(dil->pvid, hint->pvid, ID_LEN);
- dil->dev = dev;
- dm_list_add(all_devices, &dil->list);
- }
- return ECMD_PROCESSED;
- }
-
- log_debug("Getting list of all devices from system");
-
- if (!(iter = dev_iter_create(cmd->filter, 1))) {
- log_error("dev_iter creation failed.");
- return ECMD_FAILED;
- }
-
- while ((dev = dev_iter_get(cmd, iter))) {
- if (!(dil = dm_pool_zalloc(cmd->mem, sizeof(*dil)))) {
- log_error("device_id_list alloc failed.");
- goto out;
- }
-
- memcpy(dil->pvid, dev->pvid, ID_LEN);
- dil->dev = dev;
- dm_list_add(all_devices, &dil->list);
- }
-
- r = ECMD_PROCESSED;
-out:
- dev_iter_destroy(iter);
- return r;
-}
-
static int _device_list_remove(struct dm_list *devices, struct device *dev)
{
struct device_id_list *dil;
@@ -3965,47 +3908,66 @@ static struct device_id_list *_device_list_find_dev(struct dm_list *devices, str
return NULL;
}
-static int _process_device_list(struct cmd_context *cmd, struct dm_list *all_devices,
+/* Process devices that are not PVs. */
+
+static int _process_other_devices(struct cmd_context *cmd,
struct processing_handle *handle,
process_single_pv_fn_t process_single_pv)
{
+ struct dev_iter *iter;
struct physical_volume pv_dummy;
struct physical_volume *pv;
- struct device_id_list *dil;
- int ret_max = ECMD_PROCESSED;
- int ret = 0;
+ struct device *dev;
+ int failed = 0;
+ int ret;
log_debug("Processing devices that are not PVs");
/*
- * Pretend that each device is a PV with dummy values.
- * FIXME Formalise this extension or find an alternative.
+ * We want devices here that passed filters during
+ * label_scan but were found to not be PVs.
+ *
+ * No filtering used in iter, DEV_SCAN_FOUND_NOLABEL
+ * was set by label_scan which did filtering.
*/
- dm_list_iterate_items(dil, all_devices) {
- if (sigint_caught())
- return_ECMD_FAILED;
+
+ if (!(iter = dev_iter_create(NULL, 0)))
+ return_0;
+
+ while ((dev = dev_iter_get(cmd, iter))) {
+ if (sigint_caught()) {
+ failed = 1;
+ break;
+ }
+
+ if (!(dev->flags & DEV_SCAN_FOUND_NOLABEL))
+ continue;
+
+ /*
+ * Pretend that each device is a PV with dummy values.
+ * FIXME Formalise this extension or find an alternative.
+ */
memset(&pv_dummy, 0, sizeof(pv_dummy));
dm_list_init(&pv_dummy.tags);
dm_list_init(&pv_dummy.segments);
- pv_dummy.dev = dil->dev;
+ pv_dummy.dev = dev;
pv = &pv_dummy;
- log_very_verbose("Processing device %s.", dev_name(dil->dev));
+ log_very_verbose("Processing device %s.", dev_name(dev));
ret = process_single_pv(cmd, NULL, pv, handle);
-
- if (ret > ret_max)
- ret_max = ret;
+ if (ret != ECMD_PROCESSED)
+ failed = 1;
}
+ dev_iter_destroy(iter);
- return ECMD_PROCESSED;
+ return failed ? 0 : 1;
}
static int _process_duplicate_pvs(struct cmd_context *cmd,
- struct dm_list *all_devices,
struct dm_list *arg_devices,
- int process_all_devices,
+ int process_other_devices,
struct processing_handle *handle,
process_single_pv_fn_t process_single_pv)
{
@@ -4015,8 +3977,8 @@ static int _process_duplicate_pvs(struct cmd_context *cmd,
struct lvmcache_info *info;
const char *vgname;
const char *vgid;
- int ret_max = ECMD_PROCESSED;
- int ret = 0;
+ int failed = 0;
+ int ret;
struct physical_volume dummy_pv = {
.pe_size = 1,
@@ -4045,20 +4007,15 @@ static int _process_duplicate_pvs(struct cmd_context *cmd,
dm_list_init(&unused_duplicate_devs);
if (!lvmcache_get_unused_duplicates(cmd, &unused_duplicate_devs))
- return_ECMD_FAILED;
+ return_0;
dm_list_iterate_items(devl, &unused_duplicate_devs) {
/* Duplicates are displayed if -a is used or the dev is named as an arg. */
- _device_list_remove(all_devices, devl->dev);
-
- if (!process_all_devices && dm_list_empty(arg_devices))
- continue;
-
if ((dil = _device_list_find_dev(arg_devices, devl->dev)))
_device_list_remove(arg_devices, devl->dev);
- if (!process_all_devices && !dil)
+ if (!process_other_devices && !dil)
continue;
if (!(cmd->cname->flags & ENABLE_DUPLICATE_DEVS))
@@ -4087,7 +4044,7 @@ static int _process_duplicate_pvs(struct cmd_context *cmd,
*/
if (!(info = lvmcache_info_from_pvid(devl->dev->pvid, NULL, 0))) {
log_error(INTERNAL_ERROR "No info for pvid");
- return ECMD_FAILED;
+ return 0;
}
vgname = lvmcache_vgname_from_info(info);
@@ -4103,47 +4060,39 @@ static int _process_duplicate_pvs(struct cmd_context *cmd,
memset(&dummy_vg.id, 0, sizeof(dummy_vg.id));
ret = process_single_pv(cmd, &dummy_vg, &dummy_pv, handle);
-
- if (ret > ret_max)
- ret_max = ret;
+ if (ret != ECMD_PROCESSED)
+ failed = 1;
if (sigint_caught())
- return_ECMD_FAILED;
+ return_0;
}
- return ECMD_PROCESSED;
+ return failed ? 0 : 1;
}
static int _process_pvs_in_vg(struct cmd_context *cmd,
struct volume_group *vg,
- struct dm_list *all_devices,
struct dm_list *arg_devices,
struct dm_list *arg_tags,
int process_all_pvs,
- int process_all_devices,
int skip,
uint32_t error_flags,
struct processing_handle *handle,
process_single_pv_fn_t process_single_pv)
{
log_report_t saved_log_report_state = log_get_report_state();
- char vgid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
char pv_uuid[64] __attribute__((aligned(8)));
char vg_uuid[64] __attribute__((aligned(8)));
int handle_supplied = handle != NULL;
struct physical_volume *pv;
struct pv_list *pvl;
struct device_id_list *dil;
- struct device_list *devl;
- struct dm_list outdated_devs;
const char *pv_name;
int process_pv;
int do_report_ret_code = 1;
int ret_max = ECMD_PROCESSED;
int ret = 0;
- dm_list_init(&outdated_devs);
-
log_set_report_object_type(LOG_REPORT_OBJECT_TYPE_PV);
vg_uuid[0] = '\0';
@@ -4221,18 +4170,6 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
else
log_very_verbose("Processing PV %s in VG %s.", pv_name, vg->name);
- _device_list_remove(all_devices, pv->dev);
-
- /*
- * pv->dev should be found in all_devices unless it's a
- * case of a "missing device". Previously there have
- * been cases where we needed to skip processing the PV
- * if pv->dev was not found in all_devices to avoid
- * processing a PV twice, i.e. when the PV had no MDAs
- * it would be seen once in its real VG and again
- * wrongly in the orphan VG. This no longer happens.
- */
-
if (!skip) {
ret = process_single_pv(cmd, vg, pv, handle);
if (ret != ECMD_PROCESSED)
@@ -4252,13 +4189,6 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
log_set_report_object_name_and_id(NULL, NULL);
}
- if (!is_orphan_vg(vg->name)) {
- memcpy(vgid, &vg->id, ID_LEN);
- lvmcache_get_outdated_devs(cmd, vg->name, vgid, &outdated_devs);
- }
- dm_list_iterate_items(devl, &outdated_devs)
- _device_list_remove(all_devices, devl->dev);
-
do_report_ret_code = 0;
out:
if (do_report_ret_code)
@@ -4278,18 +4208,15 @@ out:
* arg_devices and arg_tags are empty, then process all PVs.
* No PV should be processed more than once.
*
- * Each PV is removed from arg_devices and all_devices when it is
- * processed. Any names remaining in arg_devices were not found, and
- * should produce an error. Any devices remaining in all_devices were
- * not found and should be processed by process_device_list().
+ * Each PV is removed from arg_devices when it is processed.
+ * Any names remaining in arg_devices were not found, and
+ * should produce an error.
*/
static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags,
struct dm_list *all_vgnameids,
- struct dm_list *all_devices,
struct dm_list *arg_devices,
struct dm_list *arg_tags,
int process_all_pvs,
- int process_all_devices,
struct processing_handle *handle,
process_single_pv_fn_t process_single_pv)
{
@@ -4358,8 +4285,8 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags,
* error_vg->pvs entries from devices list.
*/
- ret = _process_pvs_in_vg(cmd, vg ? vg : error_vg, all_devices, arg_devices, arg_tags,
- process_all_pvs, process_all_devices, skip, error_flags,
+ ret = _process_pvs_in_vg(cmd, vg ? vg : error_vg, arg_devices, arg_tags,
+ process_all_pvs, skip, error_flags,
handle, process_single_pv);
if (ret != ECMD_PROCESSED)
stack;
@@ -4405,10 +4332,9 @@ int process_each_pv(struct cmd_context *cmd,
struct dm_list arg_pvnames; /* str_list */
struct dm_list arg_devices; /* device_id_list */
struct dm_list all_vgnameids; /* vgnameid_list */
- struct dm_list all_devices; /* device_id_list */
struct device_id_list *dil;
int process_all_pvs;
- int process_all_devices;
+ int process_other_devices;
int ret_max = ECMD_PROCESSED;
int ret;
@@ -4435,7 +4361,6 @@ int process_each_pv(struct cmd_context *cmd,
dm_list_init(&arg_pvnames);
dm_list_init(&arg_devices);
dm_list_init(&all_vgnameids);
- dm_list_init(&all_devices);
/*
* Create two lists from argv:
@@ -4457,7 +4382,7 @@ int process_each_pv(struct cmd_context *cmd,
process_all_pvs = dm_list_empty(&arg_pvnames) && dm_list_empty(&arg_tags);
- process_all_devices = process_all_pvs && (cmd->cname->flags & ENABLE_ALL_DEVS) && all_is_set;
+ process_other_devices = process_all_pvs && (cmd->cname->flags & ENABLE_ALL_DEVS) && all_is_set;
/* Needed for a current listing of the global VG namespace. */
if (!only_this_vgname && !lock_global(cmd, "sh")) {
@@ -4473,16 +4398,6 @@ int process_each_pv(struct cmd_context *cmd,
goto_out;
}
- /*
- * If the caller wants to process all devices (not just PVs), then all PVs
- * from all VGs are processed first, removing them from all_devices. Then
- * any devs remaining in all_devices are processed.
- */
- if ((ret = _get_all_devices(cmd, process_all_devices, &all_devices)) != ECMD_PROCESSED) {
- ret_max = ret;
- goto_out;
- }
-
if ((ret = _get_arg_devices(cmd, &arg_pvnames, &arg_devices)) != ECMD_PROCESSED) {
/* get_arg_devices reports EINIT_FAILED for any PV names not found. */
ret_max = ret;
@@ -4491,9 +4406,8 @@ int process_each_pv(struct cmd_context *cmd,
ret_max = ECMD_FAILED; /* but ATM we've returned FAILED for all cases */
}
- ret = _process_pvs_in_vgs(cmd, read_flags, &all_vgnameids, &all_devices,
- &arg_devices, &arg_tags,
- process_all_pvs, process_all_devices,
+ ret = _process_pvs_in_vgs(cmd, read_flags, &all_vgnameids,
+ &arg_devices, &arg_tags, process_all_pvs,
handle, process_single_pv);
if (ret != ECMD_PROCESSED)
stack;
@@ -4501,58 +4415,29 @@ int process_each_pv(struct cmd_context *cmd,
ret_max = ret;
/*
- * Process the list of unused duplicate devs so they can be shown by
- * report/display commands. These are the devices that were not chosen
- * to be used in lvmcache because another device with the same PVID was
- * preferred. The unused duplicate devs are not seen by
- * _process_pvs_in_vgs, which only sees the preferred device for the
- * PVID.
- *
- * The main purpose in reporting/displaying the unused duplicate PVs
- * here is so that they do not appear to be unused/free devices or
- * orphans.
- *
- * We do not allow modifying the unused duplicate PVs. To modify a
- * non-preferred duplicate PV, e.g. pvchange -u, a filter needs to be
- * used with the command to exclude the other devices with the same
- * PVID. This results in the command seeing only the one device with
- * the PVID and allows it to be changed. (If the duplicates actually
- * represent the same underlying storage, these precautions are
- * unnecessary, but lvm can't tell when the duplicates are different
- * paths to the same storage or different underlying storage.)
- *
- * Even the preferred duplicate PV in lvmcache is limitted from being
- * modified (by allow_changes_with_duplicate_pvs setting), because lvm
- * cannot be sure that the preferred duplicate device is the correct one,
- * e.g. if a VG has two PVs, and both PVs are cloned, lvm might prefer
- * one of the original PVs and one of the cloned PVs, pairing them
- * together as the VG. Any changes on the VG or PVs in that state would
- * end up changing one of the original PVs and one of the cloned PVs.
- *
- * vgimportclone of the two cloned PVs changes their PV UUIDs and gives
- * them a new VG name.
+ * Process the list of unused duplicate devs to display duplicate PVs
+ * in two cases: 1. pvs -a (which has traditionally included duplicate
+ * PVs in addition to the expected non-PV devices), 2. pvs <devname>
+ * (duplicate dev is named on the command line.)
*/
-
- ret = _process_duplicate_pvs(cmd, &all_devices, &arg_devices, process_all_devices,
- handle, process_single_pv);
- if (ret != ECMD_PROCESSED)
- stack;
- if (ret > ret_max)
- ret_max = ret;
+ if (process_other_devices || !dm_list_empty(&arg_devices)) {
+ if (!_process_duplicate_pvs(cmd, &arg_devices, process_other_devices, handle, process_single_pv))
+ ret_max = ECMD_FAILED;
+ }
dm_list_iterate_items(dil, &arg_devices) {
log_error("Failed to find physical volume \"%s\".", dev_name(dil->dev));
ret_max = ECMD_FAILED;
}
- if (!process_all_devices)
- goto out;
+ /*
+ * pvs -a and pvdisplay -a want to show devices that are not PVs.
+ */
+ if (process_other_devices) {
+ if (!_process_other_devices(cmd, handle, process_single_pv))
+ ret_max = ECMD_FAILED;
+ }
- ret = _process_device_list(cmd, &all_devices, handle, process_single_pv);
- if (ret != ECMD_PROCESSED)
- stack;
- if (ret > ret_max)
- ret_max = ret;
out:
log_restore_report_state(saved_log_report_state);
return ret_max;
2 years, 6 months
main - devices file: unmatching system id should just be warning
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=272d1ccac8654c0d74e...
Commit: 272d1ccac8654c0d74ecf255d13de0a6222ff96f
Parent: 062ea3c4181ef158620556bbab2358bc76eeab90
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Oct 13 13:34:46 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Oct 13 13:42:04 2021 -0500
devices file: unmatching system id should just be warning
there are likely more cases than not where the systemid
does not match and the command should still run.
---
lib/device/device_id.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index ce43e61ca..e4208c56b 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -543,11 +543,8 @@ int device_ids_read(struct cmd_context *cmd)
log_debug("read devices file systemid %s", _devices_file_systemid);
if ((!cmd->system_id && _devices_file_systemid[0]) ||
(cmd->system_id && strcmp(cmd->system_id, _devices_file_systemid))) {
- log_warn("WARNING: ignoring devices file with wrong system id %s vs local %s.",
+ log_warn("WARNING: devices file has unmatching system id %s vs local %s.",
_devices_file_systemid[0] ? _devices_file_systemid : "none", cmd->system_id ?: "none");
- free_dus(&cmd->use_devices);
- ret = 0;
- goto out;
}
continue;
}
@@ -613,7 +610,6 @@ int device_ids_read(struct cmd_context *cmd)
dm_list_add(&cmd->use_devices, &du->list);
}
-out:
if (fclose(fp))
stack;
2 years, 6 months
main - fix syslog setting
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=062ea3c4181ef158620...
Commit: 062ea3c4181ef158620556bbab2358bc76eeab90
Parent: ca38251b1043c49f5453c2c571876b12aad6b450
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Oct 11 17:08:05 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Oct 11 17:11:01 2021 -0500
fix syslog setting
Just setting lvm.conf level=N should not send messages to
syslog (now the journal by default.)
Sending messages to syslog should require setting lvm.conf
log { syslog=1 level=N }.
---
lib/commands/toolcontext.c | 9 +++------
lib/config/defaults.h | 2 +-
lib/log/log.c | 7 ++++++-
lib/log/lvm-logging.h | 2 +-
4 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index f939c3e76..5144a9a6e 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -377,12 +377,11 @@ static void _init_logging(struct cmd_context *cmd)
/* Syslog */
cmd->default_settings.syslog = find_config_tree_bool(cmd, log_syslog_CFG, NULL);
- if (cmd->default_settings.syslog != 1)
+ if (cmd->default_settings.syslog)
+ init_syslog(1, DEFAULT_LOG_FACILITY);
+ else
fin_syslog();
- if (cmd->default_settings.syslog > 1)
- init_syslog(cmd->default_settings.syslog);
-
/* Debug level for log file output */
cmd->default_settings.debug = find_config_tree_int(cmd, log_level_CFG, NULL);
init_debug(cmd->default_settings.debug);
@@ -1653,8 +1652,6 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd,
bindtextdomain(INTL_PACKAGE, LOCALEDIR);
#endif
- init_syslog(DEFAULT_LOG_FACILITY);
-
if (!(cmd = zalloc(sizeof(*cmd)))) {
log_error("Failed to allocate command context");
return NULL;
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index a7a2a06df..54eba3723 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -221,7 +221,7 @@
#endif
#define DEFAULT_COMMAND_LOG_REPORT 0
-#define DEFAULT_SYSLOG 1
+#define DEFAULT_SYSLOG 0
#define DEFAULT_VERBOSE 0
#define DEFAULT_SILENT 0
#define DEFAULT_LOGLEVEL 0
diff --git a/lib/log/log.c b/lib/log/log.c
index 8ebbf947a..f9568792f 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -312,8 +312,13 @@ void init_log_while_suspended(int log_while_suspended)
_log_while_suspended = log_while_suspended;
}
-void init_syslog(int facility)
+void init_syslog(int enable, int facility)
{
+ if (!enable) {
+ _syslog = 0;
+ return;
+ }
+
if (getenv("LVM_SUPPRESS_SYSLOG"))
return;
diff --git a/lib/log/lvm-logging.h b/lib/log/lvm-logging.h
index fb18a4159..5b975a6b8 100644
--- a/lib/log/lvm-logging.h
+++ b/lib/log/lvm-logging.h
@@ -59,7 +59,7 @@ void init_abort_on_internal_errors(int fatal);
void fin_log(void);
void reset_log_duplicated(void);
-void init_syslog(int facility);
+void init_syslog(int enable, int facility);
void fin_syslog(void);
void init_log_journal(uint32_t fields);
2 years, 6 months
main - make: generate
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ca38251b1043c49f545...
Commit: ca38251b1043c49f5453c2c571876b12aad6b450
Parent: 61bd5e50232d72345b5d55ece237c05025a731ab
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Fri Aug 6 13:23:11 2021 +0200
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Oct 7 12:42:44 2021 -0500
make: generate
---
conf/example.conf.in | 258 +++++++++++++++++++++++++++++--------------
man/lvchange.8_pregen | 14 +++
man/lvconvert.8_pregen | 14 +++
man/lvcreate.8_pregen | 14 +++
man/lvdisplay.8_pregen | 12 ++
man/lvextend.8_pregen | 14 +++
man/lvm-fullreport.8_pregen | 12 ++
man/lvm-lvpoll.8_pregen | 12 ++
man/lvmconfig.8_pregen | 12 ++
man/lvmdevices.8_pregen | 14 +++
man/lvmdiskscan.8_pregen | 12 ++
man/lvreduce.8_pregen | 12 ++
man/lvremove.8_pregen | 12 ++
man/lvrename.8_pregen | 12 ++
man/lvresize.8_pregen | 14 +++
man/lvs.8_pregen | 12 ++
man/lvscan.8_pregen | 12 ++
man/pvchange.8_pregen | 12 ++
man/pvck.8_pregen | 14 +++
man/pvcreate.8_pregen | 12 ++
man/pvdisplay.8_pregen | 12 ++
man/pvmove.8_pregen | 12 ++
man/pvremove.8_pregen | 12 ++
man/pvresize.8_pregen | 12 ++
man/pvs.8_pregen | 12 ++
man/pvscan.8_pregen | 214 ++++++++++++++++++++++++++++++++++-
man/vgcfgbackup.8_pregen | 12 ++
man/vgcfgrestore.8_pregen | 14 +++
man/vgchange.8_pregen | 14 +++
man/vgck.8_pregen | 12 ++
man/vgconvert.8_pregen | 12 ++
man/vgcreate.8_pregen | 12 ++
man/vgdisplay.8_pregen | 12 ++
man/vgexport.8_pregen | 12 ++
man/vgextend.8_pregen | 12 ++
man/vgimport.8_pregen | 12 ++
man/vgimportclone.8_pregen | 12 ++
man/vgimportdevices.8_pregen | 12 ++
man/vgmerge.8_pregen | 12 ++
man/vgmknodes.8_pregen | 12 ++
man/vgreduce.8_pregen | 14 +++
man/vgremove.8_pregen | 12 ++
man/vgrename.8_pregen | 12 ++
man/vgs.8_pregen | 12 ++
man/vgscan.8_pregen | 12 ++
man/vgsplit.8_pregen | 12 ++
46 files changed, 932 insertions(+), 88 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index 5bcbc65e7..1f7c449bf 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -33,15 +33,18 @@ config {
# any configuration mismatch is ignored and the default value is used
# without any warning (a message about the configuration key not being
# found is issued in verbose mode only).
- checks = 1
+ # This configuration option has an automatic default value.
+ # checks = 1
# Configuration option config/abort_on_errors.
# Abort the LVM process if a configuration mismatch is found.
- abort_on_errors = 0
+ # This configuration option has an automatic default value.
+ # abort_on_errors = 0
# Configuration option config/profile_dir.
# Directory where LVM looks for configuration profiles.
- profile_dir = "@DEFAULT_SYS_DIR@/@DEFAULT_PROFILE_SUBDIR@"
+ # This configuration option has an automatic default value.
+ # profile_dir = "@DEFAULT_SYS_DIR@/@DEFAULT_PROFILE_SUBDIR@"
}
# Configuration section devices.
@@ -52,12 +55,14 @@ devices {
# Directory in which to create volume group device nodes.
# Commands also accept this as a prefix on volume group names.
# This configuration option is advanced.
- dir = "/dev"
+ # This configuration option has an automatic default value.
+ # dir = "/dev"
# Configuration option devices/scan.
# Directories containing device nodes to use with LVM.
# This configuration option is advanced.
- scan = [ "/dev" ]
+ # This configuration option has an automatic default value.
+ # scan = [ "/dev" ]
# Configuration option devices/obtain_device_list_from_udev.
# Obtain the list of available devices from udev.
@@ -67,14 +72,16 @@ devices {
# setting applies only to the udev-managed device directory; other
# directories will be scanned fully. LVM needs to be compiled with
# udev support for this setting to apply.
- obtain_device_list_from_udev = 0
+ # This configuration option has an automatic default value.
+ # obtain_device_list_from_udev = 0
# Configuration option devices/external_device_info_source.
# Enable device information from udev.
# If set to "udev", lvm will supplement its own native device information
# with information from libudev. This can potentially improve the detection
# of MD component devices and multipath component devices.
- external_device_info_source = "none"
+ # This configuration option has an automatic default value.
+ # external_device_info_source = "none"
# Configuration option devices/hints.
# Use a local file to remember which devices have PVs on them.
@@ -119,7 +126,7 @@ devices {
# be used, regardless of this setting, when the --devicesfile
# option is set to a specific file name.
# This configuration option has an automatic default value.
- # use_devicesfile = 0
+ # use_devicesfile = 1
# Configuration option devices/devicesfile.
# The name of the system devices file, listing devices that LVM should use.
@@ -200,7 +207,8 @@ devices {
# Restrict device scanning to block devices appearing in sysfs.
# This is a quick way of filtering out block devices that are not
# present on the system. sysfs must be part of the kernel and mounted.)
- sysfs_scan = 1
+ # This configuration option has an automatic default value.
+ # sysfs_scan = 1
# Configuration option devices/scan_lvs.
# Scan LVM LVs for layered PVs, allowing LVs to be used as PVs.
@@ -214,11 +222,19 @@ devices {
# use PVs that exist on LVs, and will not allow a PV to be created on
# an LV. The LVs are ignored using a built in device filter that
# identifies and excludes LVs.
- scan_lvs = 0
+ # This configuration option has an automatic default value.
+ # scan_lvs = 0
# Configuration option devices/multipath_component_detection.
# Ignore devices that are components of DM multipath devices.
- multipath_component_detection = 1
+ # This configuration option has an automatic default value.
+ # multipath_component_detection = 1
+
+ # Configuration option devices/multipath_wwids_file.
+ # The path to the multipath wwids file used for multipath component detection.
+ # Set this to an empty string to disable the use of the multipath wwids file.
+ # This configuration option has an automatic default value.
+ # multipath_wwids_file = "/etc/multipath/wwids"
# Configuration option devices/multipath_wwids_file.
# The path to the multipath wwids file used for multipath component detection.
@@ -235,7 +251,8 @@ devices {
# In cases where the MD superblock is located at the end of the
# component devices, it is more difficult for LVM to consistently
# identify an MD component, see the md_component_checks setting.
- md_component_detection = 1
+ # This configuration option has an automatic default value.
+ # md_component_detection = 1
# Configuration option devices/md_component_checks.
# The checks LVM should use to detect MD component devices.
@@ -259,7 +276,8 @@ devices {
# Ignore devices that are components of firmware RAID devices.
# LVM must use an external_device_info_source other than none for this
# detection to execute.
- fw_raid_component_detection = 0
+ # This configuration option has an automatic default value.
+ # fw_raid_component_detection = 0
# Configuration option devices/md_chunk_alignment.
# Align the start of a PV data area with md device's stripe-width.
@@ -268,7 +286,8 @@ devices {
# with the value detected for this setting.
# This setting is overridden by data_alignment_detection,
# data_alignment, and the --dataalignment option.
- md_chunk_alignment = 1
+ # This configuration option has an automatic default value.
+ # md_chunk_alignment = 1
# Configuration option devices/default_data_alignment.
# Align the start of a PV data area with this number of MiB.
@@ -291,7 +310,8 @@ devices {
# if they are not aligned with the value detected for this setting.
# This setting is overridden by data_alignment and the --dataalignment
# option.
- data_alignment_detection = 1
+ # This configuration option has an automatic default value.
+ # data_alignment_detection = 1
# Configuration option devices/data_alignment.
# Align the start of a PV data area with this number of KiB.
@@ -299,7 +319,8 @@ devices {
# Set to 0 to disable, in which case default_data_alignment
# is used to align the first PE in units of MiB.
# This setting is overridden by the --dataalignment option.
- data_alignment = 0
+ # This configuration option has an automatic default value.
+ # data_alignment = 0
# Configuration option devices/data_alignment_offset_detection.
# Shift the start of an aligned PV data area based on sysfs information.
@@ -310,13 +331,15 @@ devices {
# is the lowest aligned logical block, the 4KiB sectors start at
# LBA -1, and consequently sector 63 is aligned on a 4KiB boundary).
# This setting is overridden by the --dataalignmentoffset option.
- data_alignment_offset_detection = 1
+ # This configuration option has an automatic default value.
+ # data_alignment_offset_detection = 1
# Configuration option devices/ignore_suspended_devices.
# Ignore DM devices that have I/O suspended while scanning devices.
# Otherwise, LVM waits for a suspended device to become accessible.
# This should only be needed in recovery situations.
- ignore_suspended_devices = 0
+ # This configuration option has an automatic default value.
+ # ignore_suspended_devices = 0
# Configuration option devices/ignore_lvm_mirrors.
# Do not scan 'mirror' LVs to avoid possible deadlocks.
@@ -335,18 +358,21 @@ devices {
# a scan of the mirror's labels. The 'mirror' scanning problems do not
# apply to LVM RAID types like 'raid1' which handle failures in a
# different way, making them a better choice for VG stacking.
- ignore_lvm_mirrors = 1
+ # This configuration option has an automatic default value.
+ # ignore_lvm_mirrors = 1
# Configuration option devices/require_restorefile_with_uuid.
# Allow use of pvcreate --uuid without requiring --restorefile.
- require_restorefile_with_uuid = 1
+ # This configuration option has an automatic default value.
+ # require_restorefile_with_uuid = 1
# Configuration option devices/pv_min_size.
# Minimum size in KiB of block devices which can be used as PVs.
# In a clustered environment all nodes must use the same value.
# Any value smaller than 512KiB is ignored. The previous built-in
# value was 512.
- pv_min_size = 2048
+ # This configuration option has an automatic default value.
+ # pv_min_size = 2048
# Configuration option devices/issue_discards.
# Issue discards to PVs that are no longer used by an LV.
@@ -359,7 +385,8 @@ devices {
# benefit from discards, but SSDs and thinly provisioned LUNs
# generally do. If enabled, discards will only be issued if both the
# storage and kernel provide support.
- issue_discards = 0
+ # This configuration option has an automatic default value.
+ # issue_discards = 0
# Configuration option devices/allow_changes_with_duplicate_pvs.
# Allow VG modification while a PV appears on multiple devices.
@@ -372,13 +399,15 @@ devices {
# or activating LVs in it while a PV appears on multiple devices.
# Enabling this setting allows the VG to be used as usual even with
# uncertain devices.
- allow_changes_with_duplicate_pvs = 0
+ # This configuration option has an automatic default value.
+ # allow_changes_with_duplicate_pvs = 0
# Configuration option devices/allow_mixed_block_sizes.
# Allow PVs in the same VG with different logical block sizes.
# When allowed, the user is responsible to ensure that an LV is
# using PVs with matching block sizes when necessary.
- allow_mixed_block_sizes = 0
+ # This configuration option has an automatic default value.
+ # allow_mixed_block_sizes = 0
}
# Configuration section allocation.
@@ -410,7 +439,8 @@ allocation {
# policies to detect more situations where data can be grouped onto
# the same disks. This setting can be used to disable the changes
# and revert to the previous algorithm.
- maximise_cling = 1
+ # This configuration option has an automatic default value.
+ # maximise_cling = 1
# Configuration option allocation/use_blkid_wiping.
# Use blkid to detect and erase existing signatures on new PVs and LVs.
@@ -420,7 +450,8 @@ allocation {
# code is currently able to recognize: MD device signatures,
# swap signature, and LUKS signatures. To see the list of signatures
# recognized by blkid, check the output of the 'blkid -k' command.
- use_blkid_wiping = @DEFAULT_USE_BLKID_WIPING@
+ # This configuration option has an automatic default value.
+ # use_blkid_wiping = @DEFAULT_USE_BLKID_WIPING@
# Configuration option allocation/wipe_signatures_when_zeroing_new_lvs.
# Look for and erase any signatures while zeroing a new LV.
@@ -437,12 +468,14 @@ allocation {
# use_blkid_wiping.) Wiping each detected signature must be confirmed.
# When this setting is disabled, signatures on new LVs are not detected
# or erased unless the --wipesignatures option is used directly.
- wipe_signatures_when_zeroing_new_lvs = 1
+ # This configuration option has an automatic default value.
+ # wipe_signatures_when_zeroing_new_lvs = 1
# Configuration option allocation/mirror_logs_require_separate_pvs.
# Mirror logs and images will always use different PVs.
# The default setting changed in version 2.02.85.
- mirror_logs_require_separate_pvs = 0
+ # This configuration option has an automatic default value.
+ # mirror_logs_require_separate_pvs = 0
# Configuration option allocation/raid_stripe_all_devices.
# Stripe across all PVs when RAID stripes are not specified.
@@ -791,7 +824,8 @@ log {
# Configuration option log/verbose.
# Controls the messages sent to stdout or stderr.
- verbose = 0
+ # This configuration option has an automatic default value.
+ # verbose = 0
# Configuration option log/silent.
# Suppress all non-essential messages from stdout.
@@ -802,25 +836,37 @@ log {
# for syslog and lvm2_log_fn purposes.
# Any 'yes' or 'no' questions not overridden by other arguments are
# suppressed and default to 'no'.
- silent = 0
+ # This configuration option has an automatic default value.
+ # silent = 0
# Configuration option log/syslog.
# Send log messages through syslog.
- syslog = 1
+ # This configuration option has an automatic default value.
+ # syslog = 1
# Configuration option log/file.
# Write error and debug log messages to a file specified here.
# This configuration option does not have a default value defined.
+ # Configuration option log/journal.
+ # Record lvm information in the systemd journal.
+ # command: record commands that are run.
+ # output: record default output from commands.
+ # debug: record debug messages from commands.
+ # This configuration option has an automatic default value.
+ # journal = [ ]
+
# Configuration option log/overwrite.
# Overwrite the log file each time the program is run.
- overwrite = 0
+ # This configuration option has an automatic default value.
+ # overwrite = 0
# Configuration option log/level.
# The level of log messages that are sent to the log file or syslog.
# There are 6 syslog-like log levels currently in use: 2 to 7 inclusive.
# 7 is the most verbose (LOG_DEBUG).
- level = 0
+ # This configuration option has an automatic default value.
+ # level = 0
# Configuration option log/indent.
# Indent messages according to their severity.
@@ -829,7 +875,8 @@ log {
# Configuration option log/command_names.
# Display the command name on each line of output.
- command_names = 0
+ # This configuration option has an automatic default value.
+ # command_names = 0
# Configuration option log/prefix.
# A prefix to use before the log message text.
@@ -837,12 +884,14 @@ log {
# Two spaces allows you to see/grep the severity of each message.
# To make the messages look similar to the original LVM tools use:
# indent = 0, command_names = 1, prefix = " -- "
- prefix = " "
+ # This configuration option has an automatic default value.
+ # prefix = " "
# Configuration option log/activation.
# Log messages during activation.
# Don't use this in low memory situations (can deadlock).
- activation = 0
+ # This configuration option has an automatic default value.
+ # activation = 0
# Configuration option log/debug_classes.
# Select log messages by class.
@@ -850,7 +899,8 @@ log {
# debug output if the class is listed here. Classes currently
# available: memory, devices, io, activation, allocation,
# metadata, cache, locking, lvmpolld. Use "all" to see everything.
- debug_classes = [ "memory", "devices", "io", "activation", "allocation", "metadata", "cache", "locking", "lvmpolld", "dbus" ]
+ # This configuration option has an automatic default value.
+ # debug_classes = [ "memory", "devices", "io", "activation", "allocation", "metadata", "cache", "locking", "lvmpolld", "dbus" ]
# Configuration option log/debug_file_fields.
# The fields included in debug output written to log file.
@@ -877,30 +927,36 @@ backup {
# Configuration option backup/backup.
# Maintain a backup of the current metadata configuration.
# Think very hard before turning this off!
- backup = 1
+ # This configuration option has an automatic default value.
+ # backup = 1
# Configuration option backup/backup_dir.
# Location of the metadata backup files.
# Remember to back up this directory regularly!
- backup_dir = "@DEFAULT_SYS_DIR@/@DEFAULT_BACKUP_SUBDIR@"
+ # This configuration option has an automatic default value.
+ # backup_dir = "@DEFAULT_SYS_DIR@/@DEFAULT_BACKUP_SUBDIR@"
# Configuration option backup/archive.
# Maintain an archive of old metadata configurations.
# Think very hard before turning this off.
- archive = 1
+ # This configuration option has an automatic default value.
+ # archive = 1
# Configuration option backup/archive_dir.
# Location of the metdata archive files.
# Remember to back up this directory regularly!
- archive_dir = "@DEFAULT_SYS_DIR@/@DEFAULT_ARCHIVE_SUBDIR@"
+ # This configuration option has an automatic default value.
+ # archive_dir = "@DEFAULT_SYS_DIR@/@DEFAULT_ARCHIVE_SUBDIR@"
# Configuration option backup/retain_min.
# Minimum number of archives to keep.
- retain_min = 10
+ # This configuration option has an automatic default value.
+ # retain_min = 10
# Configuration option backup/retain_days.
# Minimum number of days to keep archive files.
- retain_days = 30
+ # This configuration option has an automatic default value.
+ # retain_days = 30
}
# Configuration section shell.
@@ -909,7 +965,8 @@ shell {
# Configuration option shell/history_size.
# Number of lines of history to store in ~/.lvm_history.
- history_size = 100
+ # This configuration option has an automatic default value.
+ # history_size = 100
}
# Configuration section global.
@@ -919,16 +976,19 @@ global {
# Configuration option global/umask.
# The file creation mask for any files and directories created.
# Interpreted as octal if the first digit is zero.
- umask = 077
+ # This configuration option has an automatic default value.
+ # umask = 077
# Configuration option global/test.
# No on-disk metadata changes will be made in test mode.
# Equivalent to having the -t option on every command.
- test = 0
+ # This configuration option has an automatic default value.
+ # test = 0
# Configuration option global/units.
# Default value for --units argument.
- units = "r"
+ # This configuration option has an automatic default value.
+ # units = "r"
# Configuration option global/si_unit_consistency.
# Distinguish between powers of 1024 and 1000 bytes.
@@ -936,13 +996,15 @@ global {
# e.g. KiB, MiB, GiB, and powers of 1000 bytes, e.g. KB, MB, GB.
# If scripts depend on the old behaviour, disable this setting
# temporarily until they are updated.
- si_unit_consistency = 1
+ # This configuration option has an automatic default value.
+ # si_unit_consistency = 1
# Configuration option global/suffix.
# Display unit suffix for sizes.
# This setting has no effect if the units are in human-readable form
# (global/units = "h") in which case the suffix is always displayed.
- suffix = 1
+ # This configuration option has an automatic default value.
+ # suffix = 1
# Configuration option global/activation.
# Enable/disable communication with the kernel device-mapper.
@@ -950,26 +1012,31 @@ global {
# activating any logical volumes. If the device-mapper driver
# is not present in the kernel, disabling this should suppress
# the error messages.
- activation = 1
+ # This configuration option has an automatic default value.
+ # activation = 1
# Configuration option global/proc.
# Location of proc filesystem.
# This configuration option is advanced.
- proc = "/proc"
+ # This configuration option has an automatic default value.
+ # proc = "/proc"
# Configuration option global/etc.
# Location of /etc system configuration directory.
- etc = "@CONFDIR@"
+ # This configuration option has an automatic default value.
+ # etc = "@CONFDIR@"
# Configuration option global/wait_for_locks.
# When disabled, fail if a lock request would block.
- wait_for_locks = 1
+ # This configuration option has an automatic default value.
+ # wait_for_locks = 1
# Configuration option global/locking_dir.
# Directory to use for LVM command file locks.
# Local non-LV directory that holds file-based locks while commands are
# in progress. A directory like /tmp that may get wiped on reboot is OK.
- locking_dir = "@DEFAULT_LOCK_DIR@"
+ # This configuration option has an automatic default value.
+ # locking_dir = "@DEFAULT_LOCK_DIR@"
# Configuration option global/prioritise_write_locks.
# Allow quicker VG write access during high volume read access.
@@ -978,7 +1045,8 @@ global {
# requests immediately, delay them to allow the read-write requests to
# be serviced. Without this setting, write access may be stalled by a
# high volume of read-only requests. This option only affects file locks.
- prioritise_write_locks = 1
+ # This configuration option has an automatic default value.
+ # prioritise_write_locks = 1
# Configuration option global/library_dir.
# Search this directory first for shared libraries.
@@ -988,7 +1056,8 @@ global {
# Abort a command that encounters an internal error.
# Treat any internal errors as fatal errors, aborting the process that
# encountered the internal error. Please only enable for debugging.
- abort_on_internal_errors = 0
+ # This configuration option has an automatic default value.
+ # abort_on_internal_errors = 0
# Configuration option global/metadata_read_only.
# No operations that change on-disk metadata are permitted.
@@ -996,7 +1065,8 @@ global {
# repair will still be allowed to proceed exactly as if the repair had
# been performed (except for the unchanged vg_seqno). Inappropriate
# use could mess up your system, so seek advice first!
- metadata_read_only = 0
+ # This configuration option has an automatic default value.
+ # metadata_read_only = 0
# Configuration option global/mirror_segtype_default.
# The segment type used by the short mirroring option -m.
@@ -1022,7 +1092,8 @@ global {
# cluster-aware and cannot be used in a shared (active/active)
# fashion in a cluster.
#
- mirror_segtype_default = "@DEFAULT_MIRROR_SEGTYPE@"
+ # This configuration option has an automatic default value.
+ # mirror_segtype_default = "@DEFAULT_MIRROR_SEGTYPE@"
# Configuration option global/support_mirrored_mirror_log.
# Enable mirrored 'mirror' log type for testing.
@@ -1052,7 +1123,8 @@ global {
# effectively creating a RAID 0+1 array. The layering is suboptimal
# in terms of providing redundancy and performance.
#
- raid10_segtype_default = "@DEFAULT_RAID10_SEGTYPE@"
+ # This configuration option has an automatic default value.
+ # raid10_segtype_default = "@DEFAULT_RAID10_SEGTYPE@"
# Configuration option global/sparse_segtype_default.
# The segment type used by the -V -L combination.
@@ -1072,7 +1144,8 @@ global {
# metadata. It has better performance, especially when more data
# is used. It also supports full snapshots.
#
- sparse_segtype_default = "@DEFAULT_SPARSE_SEGTYPE@"
+ # This configuration option has an automatic default value.
+ # sparse_segtype_default = "@DEFAULT_SPARSE_SEGTYPE@"
# Configuration option global/lvdisplay_shows_full_device_path.
# Enable this to reinstate the previous lvdisplay name format.
@@ -1107,7 +1180,8 @@ global {
# Applicable only if LVM is compiled with lockd support in which
# case there is also lvmlockd(8) man page available for more
# information.
- use_lvmlockd = 0
+ # This configuration option has an automatic default value.
+ # use_lvmlockd = 0
# Configuration option global/lvmlockd_lock_retries.
# Retry lvmlockd lock requests this many times.
@@ -1280,15 +1354,18 @@ global {
# uname
# Set the system ID from the hostname (uname) of the system.
# System IDs beginning localhost are not permitted.
+ # appmachineid
+ # Use an LVM-specific derivation of the local machine-id as the
+ # system ID. See 'man machine-id'.
# machineid
- # Use the contents of the machine-id file to set the system ID.
- # Some systems create this file at installation time.
- # See 'man machine-id' and global/etc.
+ # Use the contents of the machine-id file to set the system ID
+ # (appmachineid is recommended.)
# file
# Use the contents of another file (system_id_file) to set the
# system ID.
#
- system_id_source = "none"
+ # This configuration option has an automatic default value.
+ # system_id_source = "none"
# Configuration option global/system_id_file.
# The full path to the file containing a system ID.
@@ -1308,13 +1385,15 @@ global {
# and to use its own control group. When this option is disabled, LVM
# commands will supervise long running operations by forking themselves.
# Applicable only if LVM is compiled with lvmpolld support.
- use_lvmpolld = @DEFAULT_USE_LVMPOLLD@
+ # This configuration option has an automatic default value.
+ # use_lvmpolld = @DEFAULT_USE_LVMPOLLD@
# Configuration option global/notify_dbus.
# Enable D-Bus notification from LVM commands.
# When enabled, an LVM command that changes PVs, changes VG metadata,
# or changes the activation state of an LV will send a notification.
- notify_dbus = 1
+ # This configuration option has an automatic default value.
+ # notify_dbus = 1
# Configuration option global/io_memory_size.
# The amount of memory in KiB that LVM allocates to perform disk io.
@@ -1335,7 +1414,8 @@ activation {
# Useful for debugging problems with activation. Some of the checks may
# be expensive, so it's best to use this only when there seems to be a
# problem.
- checks = 0
+ # This configuration option has an automatic default value.
+ # checks = 0
# Configuration option activation/udev_sync.
# Use udev notifications to synchronize udev and LVM.
@@ -1346,14 +1426,16 @@ activation {
# that ignore the devices LVM creates. If enabled when udev is not
# running, and LVM processes are waiting for udev, run the command
# 'dmsetup udevcomplete_all' to wake them up.
- udev_sync = 1
+ # This configuration option has an automatic default value.
+ # udev_sync = 1
# Configuration option activation/udev_rules.
# Use udev rules to manage LV device nodes and symlinks.
# When disabled, LVM will manage the device nodes and symlinks for
# active LVs itself. Manual intervention may be required if this
# setting is changed while LVs are active.
- udev_rules = 1
+ # This configuration option has an automatic default value.
+ # udev_rules = 1
# Configuration option activation/verify_udev_operations.
# Use extra checks in LVM to verify udev operations.
@@ -1368,7 +1450,8 @@ activation {
# If LV deactivation fails, LVM will retry for a few seconds before
# failing. This may happen because a process run from a quick udev rule
# temporarily opened the device.
- retry_deactivation = 1
+ # This configuration option has an automatic default value.
+ # retry_deactivation = 1
# Configuration option activation/missing_stripe_filler.
# Method to fill missing stripes when activating an incomplete LV.
@@ -1379,7 +1462,8 @@ activation {
# other than 'error' with mirrored or snapshotted volumes is likely to
# result in data corruption.
# This configuration option is advanced.
- missing_stripe_filler = "error"
+ # This configuration option has an automatic default value.
+ # missing_stripe_filler = "error"
# Configuration option activation/use_linear_target.
# Use the linear target to optimize single stripe LVs.
@@ -1501,7 +1585,8 @@ activation {
# The clean/dirty state of data is tracked for each region.
# The value is rounded down to a power of two if necessary, and
# is ignored if it is not a multiple of the machine memory page size.
- raid_region_size = 2048
+ # This configuration option has an automatic default value.
+ # raid_region_size = 2048
# Configuration option activation/error_when_full.
# Return errors if a thin pool runs out of space.
@@ -1546,7 +1631,8 @@ activation {
# Attempt to use any extra physical volumes in the VG as spares and
# replace faulty devices.
#
- raid_fault_policy = "warn"
+ # This configuration option has an automatic default value.
+ # raid_fault_policy = "warn"
# Configuration option activation/mirror_image_fault_policy.
# Defines how a device failure in a 'mirror' LV is handled.
@@ -1583,13 +1669,15 @@ activation {
# 'remove' if no suitable device and space can be allocated for the
# replacement.
#
- mirror_image_fault_policy = "remove"
+ # This configuration option has an automatic default value.
+ # mirror_image_fault_policy = "remove"
# Configuration option activation/mirror_log_fault_policy.
# Defines how a device failure in a 'mirror' log LV is handled.
# The mirror_image_fault_policy description for mirrored LVs also
# applies to mirrored log LVs.
- mirror_log_fault_policy = "allocate"
+ # This configuration option has an automatic default value.
+ # mirror_log_fault_policy = "allocate"
# Configuration option activation/snapshot_autoextend_threshold.
# Auto-extend a snapshot when its usage exceeds this percent.
@@ -1604,7 +1692,8 @@ activation {
# 840M, it is extended to 1.44G:
# snapshot_autoextend_threshold = 70
#
- snapshot_autoextend_threshold = 100
+ # This configuration option has an automatic default value.
+ # snapshot_autoextend_threshold = 100
# Configuration option activation/snapshot_autoextend_percent.
# Auto-extending a snapshot adds this percent extra space.
@@ -1617,7 +1706,8 @@ activation {
# 840M, it is extended to 1.44G:
# snapshot_autoextend_percent = 20
#
- snapshot_autoextend_percent = 20
+ # This configuration option has an automatic default value.
+ # snapshot_autoextend_percent = 20
# Configuration option activation/thin_pool_autoextend_threshold.
# Auto-extend a thin pool when its usage exceeds this percent.
@@ -1632,7 +1722,8 @@ activation {
# 840M, it is extended to 1.44G:
# thin_pool_autoextend_threshold = 70
#
- thin_pool_autoextend_threshold = 100
+ # This configuration option has an automatic default value.
+ # thin_pool_autoextend_threshold = 100
# Configuration option activation/thin_pool_autoextend_percent.
# Auto-extending a thin pool adds this percent extra space.
@@ -1645,7 +1736,8 @@ activation {
# 840M, it is extended to 1.44G:
# thin_pool_autoextend_percent = 20
#
- thin_pool_autoextend_percent = 20
+ # This configuration option has an automatic default value.
+ # thin_pool_autoextend_percent = 20
# Configuration option activation/vdo_pool_autoextend_threshold.
# Auto-extend a VDO pool when its usage exceeds this percent.
@@ -1704,7 +1796,8 @@ activation {
# Monitor LVs that are activated.
# The --ignoremonitoring option overrides this setting.
# When enabled, LVM will ask dmeventd to monitor activated LVs.
- monitoring = 1
+ # This configuration option has an automatic default value.
+ # monitoring = 1
# Configuration option activation/polling_interval.
# Check pvmove or lvconvert progress at this interval (seconds).
@@ -1746,7 +1839,8 @@ activation {
# This setting should not normally be used, but may sometimes
# assist with data recovery.
#
- activation_mode = "degraded"
+ # This configuration option has an automatic default value.
+ # activation_mode = "degraded"
# Configuration option activation/lock_start_list.
# Locking is started only for VGs selected by this list.
diff --git a/man/lvchange.8_pregen b/man/lvchange.8_pregen
index 2ecd491d7..b559c89c9 100644
--- a/man/lvchange.8_pregen
+++ b/man/lvchange.8_pregen
@@ -66,6 +66,8 @@ lvchange \(em Change the attributes of logical volume(s)
\fB--ignorelockingfailure\fP
.br
\fB--ignoremonitoring\fP
+.br
+ \fB--journal\fP \fIString\fP
.br
\fB--lockopt\fP \fIString\fP
.br
@@ -421,6 +423,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -678,6 +682,16 @@ Do not interact with dmeventd unless --monitor is specified.
Do not use this if dmeventd is already monitoring a device.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvconvert.8_pregen b/man/lvconvert.8_pregen
index db52c588a..679519303 100644
--- a/man/lvconvert.8_pregen
+++ b/man/lvconvert.8_pregen
@@ -66,6 +66,8 @@ lvconvert \(em Change logical volume layout
\fB-h\fP|\fB--help\fP
.br
\fB-i\fP|\fB--interval\fP \fINumber\fP
+.br
+ \fB--journal\fP \fIString\fP
.br
\fB--lockopt\fP \fIString\fP
.br
@@ -965,6 +967,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -1187,6 +1191,16 @@ Display help text.
Report progress at regular intervals.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvcreate.8_pregen b/man/lvcreate.8_pregen
index 931613285..2cccbbe56 100644
--- a/man/lvcreate.8_pregen
+++ b/man/lvcreate.8_pregen
@@ -74,6 +74,8 @@ lvcreate \(em Create a logical volume
\fB-K\fP|\fB--ignoreactivationskip\fP
.br
\fB--ignoremonitoring\fP
+.br
+ \fB--journal\fP \fIString\fP
.br
\fB--lockopt\fP \fIString\fP
.br
@@ -807,6 +809,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -1079,6 +1083,16 @@ Do not interact with dmeventd unless --monitor is specified.
Do not use this if dmeventd is already monitoring a device.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvdisplay.8_pregen b/man/lvdisplay.8_pregen
index f74b49190..a1740ebed 100644
--- a/man/lvdisplay.8_pregen
+++ b/man/lvdisplay.8_pregen
@@ -110,6 +110,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -230,6 +232,16 @@ Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvextend.8_pregen b/man/lvextend.8_pregen
index c0c32dd95..be6992e94 100644
--- a/man/lvextend.8_pregen
+++ b/man/lvextend.8_pregen
@@ -38,6 +38,8 @@ lvextend \(em Add space to a logical volume
\fB-f\fP|\fB--force\fP
.br
\fB-h\fP|\fB--help\fP
+.br
+ \fB--journal\fP \fIString\fP
.br
\fB--lockopt\fP \fIString\fP
.br
@@ -253,6 +255,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -377,6 +381,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvm-fullreport.8_pregen b/man/lvm-fullreport.8_pregen
index 19e6c4e56..02b38ef40 100644
--- a/man/lvm-fullreport.8_pregen
+++ b/man/lvm-fullreport.8_pregen
@@ -106,6 +106,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -204,6 +206,16 @@ Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvm-lvpoll.8_pregen b/man/lvm-lvpoll.8_pregen
index e826a033e..7f45f6eb3 100644
--- a/man/lvm-lvpoll.8_pregen
+++ b/man/lvm-lvpoll.8_pregen
@@ -62,6 +62,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -149,6 +151,16 @@ Display help text.
Report progress at regular intervals.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvmconfig.8_pregen b/man/lvmconfig.8_pregen
index ee0ab0255..51946e1ec 100644
--- a/man/lvmconfig.8_pregen
+++ b/man/lvmconfig.8_pregen
@@ -103,6 +103,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -206,6 +208,16 @@ and \fBdiff\fP types include unsupported settings in their output by default,
all the other types ignore unsupported settings.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB-l\fP|\fB--list\fP
.br
List config settings with summarizing comment. This is the same as using
diff --git a/man/lvmdevices.8_pregen b/man/lvmdevices.8_pregen
index d2c18d90b..d64c3a31a 100644
--- a/man/lvmdevices.8_pregen
+++ b/man/lvmdevices.8_pregen
@@ -37,6 +37,8 @@ lvmdevices \(em Manage the devices file
\fB--driverloaded\fP \fBy\fP|\fBn\fP
.br
\fB-h\fP|\fB--help\fP
+.br
+ \fB--journal\fP \fIString\fP
.br
\fB--lockopt\fP \fIString\fP
.br
@@ -288,6 +290,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -385,6 +389,16 @@ For testing and debugging.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvmdiskscan.8_pregen b/man/lvmdiskscan.8_pregen
index 42b9c50f3..7fd3d941d 100644
--- a/man/lvmdiskscan.8_pregen
+++ b/man/lvmdiskscan.8_pregen
@@ -60,6 +60,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -125,6 +127,16 @@ For testing and debugging.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvreduce.8_pregen b/man/lvreduce.8_pregen
index bfa7c720c..ea960eb53 100644
--- a/man/lvreduce.8_pregen
+++ b/man/lvreduce.8_pregen
@@ -82,6 +82,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -181,6 +183,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvremove.8_pregen b/man/lvremove.8_pregen
index 86252a627..2bd7997a3 100644
--- a/man/lvremove.8_pregen
+++ b/man/lvremove.8_pregen
@@ -88,6 +88,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -165,6 +167,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvrename.8_pregen b/man/lvrename.8_pregen
index 072699ff6..d41a4c241 100644
--- a/man/lvrename.8_pregen
+++ b/man/lvrename.8_pregen
@@ -72,6 +72,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -143,6 +145,16 @@ For testing and debugging.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvresize.8_pregen b/man/lvresize.8_pregen
index d1c50ba52..f3ea2536c 100644
--- a/man/lvresize.8_pregen
+++ b/man/lvresize.8_pregen
@@ -38,6 +38,8 @@ lvresize \(em Resize a logical volume
\fB-f\fP|\fB--force\fP
.br
\fB-h\fP|\fB--help\fP
+.br
+ \fB--journal\fP \fIString\fP
.br
\fB--lockopt\fP \fIString\fP
.br
@@ -211,6 +213,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -335,6 +339,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvs.8_pregen b/man/lvs.8_pregen
index 9e185b5b4..2b2c5f193 100644
--- a/man/lvs.8_pregen
+++ b/man/lvs.8_pregen
@@ -106,6 +106,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -214,6 +216,16 @@ Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/lvscan.8_pregen b/man/lvscan.8_pregen
index 7a1bfeb65..f459ab35b 100644
--- a/man/lvscan.8_pregen
+++ b/man/lvscan.8_pregen
@@ -65,6 +65,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -148,6 +150,16 @@ Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/pvchange.8_pregen b/man/pvchange.8_pregen
index f2f96a180..4add9ca69 100644
--- a/man/pvchange.8_pregen
+++ b/man/pvchange.8_pregen
@@ -109,6 +109,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -208,6 +210,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/pvck.8_pregen b/man/pvck.8_pregen
index 225ac7dc1..88200f21e 100644
--- a/man/pvck.8_pregen
+++ b/man/pvck.8_pregen
@@ -32,6 +32,8 @@ pvck \(em Check metadata on physical volumes
\fB-f\fP|\fB--file\fP \fIString\fP
.br
\fB-h\fP|\fB--help\fP
+.br
+ \fB--journal\fP \fIString\fP
.br
\fB--labelsector\fP \fINumber\fP
.br
@@ -307,6 +309,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -393,6 +397,16 @@ Metadata file to read or write.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--labelsector\fP \fINumber\fP
.br
By default the PV is labelled with an LVM2 identifier in its second
diff --git a/man/pvcreate.8_pregen b/man/pvcreate.8_pregen
index 1d9914ccf..a74a5ec2a 100644
--- a/man/pvcreate.8_pregen
+++ b/man/pvcreate.8_pregen
@@ -158,6 +158,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -258,6 +260,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--labelsector\fP \fINumber\fP
.br
By default the PV is labelled with an LVM2 identifier in its second
diff --git a/man/pvdisplay.8_pregen b/man/pvdisplay.8_pregen
index af8f0804c..22a0992b5 100644
--- a/man/pvdisplay.8_pregen
+++ b/man/pvdisplay.8_pregen
@@ -108,6 +108,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -220,6 +222,16 @@ Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/pvmove.8_pregen b/man/pvmove.8_pregen
index 095b592a4..0f70497a2 100644
--- a/man/pvmove.8_pregen
+++ b/man/pvmove.8_pregen
@@ -112,6 +112,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -234,6 +236,16 @@ Display help text.
Report progress at regular intervals.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/pvremove.8_pregen b/man/pvremove.8_pregen
index 834a51678..3d4a86c09 100644
--- a/man/pvremove.8_pregen
+++ b/man/pvremove.8_pregen
@@ -61,6 +61,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -132,6 +134,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/pvresize.8_pregen b/man/pvresize.8_pregen
index c2f7b6bb4..87d87c8ce 100644
--- a/man/pvresize.8_pregen
+++ b/man/pvresize.8_pregen
@@ -56,6 +56,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -121,6 +123,16 @@ For testing and debugging.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/pvs.8_pregen b/man/pvs.8_pregen
index 11313f50c..32c28e4d1 100644
--- a/man/pvs.8_pregen
+++ b/man/pvs.8_pregen
@@ -104,6 +104,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -204,6 +206,16 @@ Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/pvscan.8_pregen b/man/pvscan.8_pregen
index 902a3527a..a15138d8b 100644
--- a/man/pvscan.8_pregen
+++ b/man/pvscan.8_pregen
@@ -6,12 +6,80 @@ pvscan \(em List all physical volumes
.
.SH SYNOPSIS
.
-\fBpvscan\fP \fIoption_args\fP
+\fBpvscan\fP \fIoption_args\fP \fIposition_args\fP
.br
[ \fIoption_args\fP ]
.br
[ \fIposition_args\fP ]
.br
+.P
+.ad l
+ \fB-a\fP|\fB--activate\fP \fBy\fP|\fBn\fP|\fBay\fP
+.br
+ \fB--cache\fP
+.br
+ \fB--checkcomplete\fP
+.br
+ \fB--commandprofile\fP \fIString\fP
+.br
+ \fB--config\fP \fIString\fP
+.br
+ \fB-d\fP|\fB--debug\fP
+.br
+ \fB--devices\fP \fIPV\fP
+.br
+ \fB--devicesfile\fP \fIString\fP
+.br
+ \fB--driverloaded\fP \fBy\fP|\fBn\fP
+.br
+ \fB-e\fP|\fB--exported\fP
+.br
+ \fB-h\fP|\fB--help\fP
+.br
+ \fB--ignorelockingfailure\fP
+.br
+ \fB--journal\fP \fIString\fP
+.br
+ \fB--listlvs\fP
+.br
+ \fB--listvg\fP
+.br
+ \fB--lockopt\fP \fIString\fP
+.br
+ \fB--longhelp\fP
+.br
+ \fB-j\fP|\fB--major\fP \fINumber\fP
+.br
+ \fB--minor\fP \fINumber\fP
+.br
+ \fB--nolocking\fP
+.br
+ \fB--noudevsync\fP
+.br
+ \fB-n\fP|\fB--novolumegroup\fP
+.br
+ \fB--profile\fP \fIString\fP
+.br
+ \fB-q\fP|\fB--quiet\fP
+.br
+ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP
+.br
+ \fB-s\fP|\fB--short\fP
+.br
+ \fB-t\fP|\fB--test\fP
+.br
+ \fB--udevoutput\fP
+.br
+ \fB-u\fP|\fB--uuid\fP
+.br
+ \fB-v\fP|\fB--verbose\fP
+.br
+ \fB--version\fP
+.br
+ \fB--vgonline\fP
+.br
+ \fB-y\fP|\fB--yes\fP
+.ad b
.
.SH DESCRIPTION
.
@@ -92,21 +160,29 @@ Display PV information.
.br
[ \fB-u\fP|\fB--uuid\fP ]
.br
+[ \fB--ignorelockingfailure\fP ]
+.br
+[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP ]
+.br
[ COMMON_OPTIONS ]
.ad b
.RE
.P
-Autoactivate a VG when all PVs are online.
+\(em
+.P
+Record that a PV is online or offline.
.br
.P
\fBpvscan\fP \fB--cache\fP
.br
.RS 4
.ad l
-[ \fB-a\fP|\fB--activate\fP \fBay\fP ]
-.br
[ \fB-j\fP|\fB--major\fP \fINumber\fP ]
.br
+[ \fB--ignorelockingfailure\fP ]
+.br
+[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP ]
+.br
[ \fB--minor\fP \fINumber\fP ]
.br
[ \fB--noudevsync\fP ]
@@ -118,16 +194,100 @@ Autoactivate a VG when all PVs are online.
[ \fIString\fP|\fIPV\fP ... ]
.RE
.P
-Common options for command:
-.
+\(em
+.P
+Record that a PV is online and autoactivate the VG if complete.
+.br
+.P
+\fBpvscan\fP \fB--cache\fP \fB-a\fP|\fB--activate\fP \fBay\fP
+.br
.RS 4
.ad l
+[ \fB-j\fP|\fB--major\fP \fINumber\fP ]
+.br
[ \fB--ignorelockingfailure\fP ]
.br
[ \fB--reportformat\fP \fBbasic\fP|\fBjson\fP ]
+.br
+[ \fB--minor\fP \fINumber\fP ]
+.br
+[ \fB--noudevsync\fP ]
+.br
+[ COMMON_OPTIONS ]
+.ad b
+.RE
+.RS 4
+[ \fIString\fP|\fIPV\fP ... ]
+.RE
+.P
+\(em
+.P
+Record that a PV is online and list the VG using the PV.
+.br
+.P
+\fBpvscan\fP \fB--cache\fP \fB--listvg\fP \fIPV\fP
+.br
+.RS 4
+.ad l
+[ \fB--ignorelockingfailure\fP ]
+.br
+[ \fB--checkcomplete\fP ]
+.br
+[ \fB--vgonline\fP ]
+.br
+[ \fB--udevoutput\fP ]
+.br
+[ COMMON_OPTIONS ]
.ad b
.RE
.P
+\(em
+.P
+Record that a PV is online and list LVs using the PV.
+.br
+.P
+\fBpvscan\fP \fB--cache\fP \fB--listlvs\fP \fIPV\fP
+.br
+.RS 4
+.ad l
+[ \fB--ignorelockingfailure\fP ]
+.br
+[ \fB--checkcomplete\fP ]
+.br
+[ \fB--vgonline\fP ]
+.br
+[ COMMON_OPTIONS ]
+.ad b
+.RE
+.P
+\(em
+.P
+List LVs using the PV.
+.br
+.P
+\fBpvscan\fP \fB--listlvs\fP \fIPV\fP
+.br
+.RS 4
+.ad l
+[ COMMON_OPTIONS ]
+.ad b
+.RE
+.P
+\(em
+.P
+List the VG using the PV.
+.br
+.P
+\fBpvscan\fP \fB--listvg\fP \fIPV\fP
+.br
+.RS 4
+.ad l
+[ COMMON_OPTIONS ]
+.ad b
+.RE
+.P
+\(em
+.P
Common options for lvm:
.
.RS 4
@@ -154,6 +314,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -183,6 +345,15 @@ Auto-activate LVs in a VG when the PVs scanned have completed the VG.
Scan one or more devices and record that they are online.
.
.HP
+\fB--checkcomplete\fP
+.br
+Check if all the devices used by a VG or LV are present,
+and print "complete" or "incomplete" for each listed
+VG or LV. This option is used as a part of event-based
+autoactivation, so pvscan will do nothing if this option
+is set and event_activation=0 in the config settings.
+.
+.HP
\fB--commandprofile\fP \fIString\fP
.br
The command profile to use for command configuration.
@@ -241,6 +412,26 @@ Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
+\fB--listlvs\fP
+.br
+Print a list of LVs that use the device.
+.
+.HP
+\fB--listvg\fP
+.br
+Print the VG that uses the device.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
@@ -323,6 +514,11 @@ error messages in multi-stage operations if a tool relies on reading
back metadata it believes has changed but hasn't.
.
.HP
+\fB--udevoutput\fP
+.br
+Command output is modified to be imported from a udev rule.
+.
+.HP
\fB-u\fP|\fB--uuid\fP
.br
Show UUIDs in addition to device names.
@@ -339,6 +535,12 @@ of messages sent to stdout and stderr.
Display version information.
.
.HP
+\fB--vgonline\fP
+.br
+The first command to see a complete VG will report it uniquely.
+Other commands to see the complete VG will report it differently.
+.
+.HP
\fB-y\fP|\fB--yes\fP
.br
Do not prompt for confirmation interactively but always assume the
diff --git a/man/vgcfgbackup.8_pregen b/man/vgcfgbackup.8_pregen
index ae9b476f5..5e658093a 100644
--- a/man/vgcfgbackup.8_pregen
+++ b/man/vgcfgbackup.8_pregen
@@ -81,6 +81,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -165,6 +167,16 @@ Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgcfgrestore.8_pregen b/man/vgcfgrestore.8_pregen
index 2c4d18e30..695e05582 100644
--- a/man/vgcfgrestore.8_pregen
+++ b/man/vgcfgrestore.8_pregen
@@ -31,6 +31,8 @@ vgcfgrestore \(em Restore volume group configuration
\fB--force\fP
.br
\fB-h\fP|\fB--help\fP
+.br
+ \fB--journal\fP \fIString\fP
.br
\fB-l\fP|\fB--list\fP
.br
@@ -164,6 +166,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -244,6 +248,16 @@ thin pool kernel metadata precisely.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB-l\fP|\fB--list\fP
.br
List metadata backup and archive files pertaining to the VG.
diff --git a/man/vgchange.8_pregen b/man/vgchange.8_pregen
index 19797daa4..05c67aead 100644
--- a/man/vgchange.8_pregen
+++ b/man/vgchange.8_pregen
@@ -52,6 +52,8 @@ vgchange \(em Change volume group attributes
\fB--ignorelockingfailure\fP
.br
\fB--ignoremonitoring\fP
+.br
+ \fB--journal\fP \fIString\fP
.br
\fB--lockopt\fP \fIString\fP
.br
@@ -421,6 +423,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -601,6 +605,16 @@ Do not interact with dmeventd unless --monitor is specified.
Do not use this if dmeventd is already monitoring a device.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgck.8_pregen b/man/vgck.8_pregen
index 5e575f6f7..a8fa33f4b 100644
--- a/man/vgck.8_pregen
+++ b/man/vgck.8_pregen
@@ -72,6 +72,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -137,6 +139,16 @@ For testing and debugging.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgconvert.8_pregen b/man/vgconvert.8_pregen
index baf3b5bdd..4d54c2b27 100644
--- a/man/vgconvert.8_pregen
+++ b/man/vgconvert.8_pregen
@@ -67,6 +67,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -153,6 +155,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--labelsector\fP \fINumber\fP
.br
By default the PV is labelled with an LVM2 identifier in its second
diff --git a/man/vgcreate.8_pregen b/man/vgcreate.8_pregen
index b0d9a04de..9bb8d3868 100644
--- a/man/vgcreate.8_pregen
+++ b/man/vgcreate.8_pregen
@@ -107,6 +107,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -235,6 +237,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--labelsector\fP \fINumber\fP
.br
By default the PV is labelled with an LVM2 identifier in its second
diff --git a/man/vgdisplay.8_pregen b/man/vgdisplay.8_pregen
index 50fb24bd6..9c694921d 100644
--- a/man/vgdisplay.8_pregen
+++ b/man/vgdisplay.8_pregen
@@ -105,6 +105,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -217,6 +219,16 @@ Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgexport.8_pregen b/man/vgexport.8_pregen
index 429483894..a87058946 100644
--- a/man/vgexport.8_pregen
+++ b/man/vgexport.8_pregen
@@ -93,6 +93,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -162,6 +164,16 @@ For testing and debugging.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgextend.8_pregen b/man/vgextend.8_pregen
index 6a7ab2bee..2b2650527 100644
--- a/man/vgextend.8_pregen
+++ b/man/vgextend.8_pregen
@@ -85,6 +85,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -176,6 +178,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--labelsector\fP \fINumber\fP
.br
By default the PV is labelled with an LVM2 identifier in its second
diff --git a/man/vgimport.8_pregen b/man/vgimport.8_pregen
index 70f8b76f6..5cd8fab84 100644
--- a/man/vgimport.8_pregen
+++ b/man/vgimport.8_pregen
@@ -81,6 +81,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -157,6 +159,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgimportclone.8_pregen b/man/vgimportclone.8_pregen
index 9bc8a4654..bf0af5841 100644
--- a/man/vgimportclone.8_pregen
+++ b/man/vgimportclone.8_pregen
@@ -62,6 +62,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -147,6 +149,16 @@ will not be changed (nor will their associated PVs).
Add devices to the devices file.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgimportdevices.8_pregen b/man/vgimportdevices.8_pregen
index 30bbb906e..5897e29ad 100644
--- a/man/vgimportdevices.8_pregen
+++ b/man/vgimportdevices.8_pregen
@@ -86,6 +86,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -161,6 +163,16 @@ See \fBlvmsystemid\fP(7) for more information about foreign VGs.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgmerge.8_pregen b/man/vgmerge.8_pregen
index f98ad7403..a36e0c7bd 100644
--- a/man/vgmerge.8_pregen
+++ b/man/vgmerge.8_pregen
@@ -59,6 +59,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -130,6 +132,16 @@ For testing and debugging.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB-l\fP|\fB--list\fP
.br
Display merged destination VG like vgdisplay -v.
diff --git a/man/vgmknodes.8_pregen b/man/vgmknodes.8_pregen
index 7432befb0..0a03e1582 100644
--- a/man/vgmknodes.8_pregen
+++ b/man/vgmknodes.8_pregen
@@ -66,6 +66,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -137,6 +139,16 @@ Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgreduce.8_pregen b/man/vgreduce.8_pregen
index 1b897a6d3..f3178a618 100644
--- a/man/vgreduce.8_pregen
+++ b/man/vgreduce.8_pregen
@@ -31,6 +31,8 @@ vgreduce \(em Remove physical volume(s) from a volume group
\fB-f\fP|\fB--force\fP
.br
\fB-h\fP|\fB--help\fP
+.br
+ \fB--journal\fP \fIString\fP
.br
\fB--lockopt\fP \fIString\fP
.br
@@ -144,6 +146,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -226,6 +230,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgremove.8_pregen b/man/vgremove.8_pregen
index 0b6ebb522..779c0f13e 100644
--- a/man/vgremove.8_pregen
+++ b/man/vgremove.8_pregen
@@ -67,6 +67,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -138,6 +140,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgrename.8_pregen b/man/vgrename.8_pregen
index c600a3fcf..d3e776ca4 100644
--- a/man/vgrename.8_pregen
+++ b/man/vgrename.8_pregen
@@ -85,6 +85,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -162,6 +164,16 @@ Use with extreme caution.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgs.8_pregen b/man/vgs.8_pregen
index 63d1c7dc3..ee5083a93 100644
--- a/man/vgs.8_pregen
+++ b/man/vgs.8_pregen
@@ -102,6 +102,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -201,6 +203,16 @@ Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgscan.8_pregen b/man/vgscan.8_pregen
index bd554fa82..824e7f673 100644
--- a/man/vgscan.8_pregen
+++ b/man/vgscan.8_pregen
@@ -59,6 +59,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -130,6 +132,16 @@ Allows a command to continue with read-only metadata
operations after locking failures.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
diff --git a/man/vgsplit.8_pregen b/man/vgsplit.8_pregen
index f45cfcabc..065c8b52a 100644
--- a/man/vgsplit.8_pregen
+++ b/man/vgsplit.8_pregen
@@ -102,6 +102,8 @@ Common options for lvm:
.br
[ \fB--driverloaded\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--journal\fP \fIString\fP ]
+.br
[ \fB--lockopt\fP \fIString\fP ]
.br
[ \fB--longhelp\fP ]
@@ -198,6 +200,16 @@ For testing and debugging.
Display help text.
.
.HP
+\fB--journal\fP \fIString\fP
+.br
+Record information in the systemd journal.
+This information is in addition to information
+enabled by the lvm.conf log/journal setting.
+command: record information about the command.
+output: record the default command output.
+debug: record full command debugging.
+.
+.HP
\fB--lockopt\fP \fIString\fP
.br
Used to pass options for special cases to lvmlockd.
2 years, 6 months
main - lvmdbusd: Use ID_FS_TYPE UDev property in udevwatch
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=61bd5e50232d72345b5...
Commit: 61bd5e50232d72345b5d55ece237c05025a731ab
Parent: 5ac4b662df525039eda6a5fc461da60c6ea42c2a
Author: Vojtech Trefny <vtrefny(a)redhat.com>
AuthorDate: Wed Jun 2 17:17:40 2021 +0200
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Oct 7 12:42:44 2021 -0500
lvmdbusd: Use ID_FS_TYPE UDev property in udevwatch
'.ID_FS_TYPE_NEW' is a custom property added by an LVM UDev rule
which is now being removed and 'ID_FS_TYPE' has the same value.
Signed-off-by: Vojtech Trefny <vtrefny(a)redhat.com>
---
daemons/lvmdbusd/udevwatch.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/daemons/lvmdbusd/udevwatch.py b/daemons/lvmdbusd/udevwatch.py
index b53b18003..f9b3e4ad1 100644
--- a/daemons/lvmdbusd/udevwatch.py
+++ b/daemons/lvmdbusd/udevwatch.py
@@ -52,8 +52,8 @@ def filter_event(action, device):
# when appropriate.
refresh = False
- if '.ID_FS_TYPE_NEW' in device:
- fs_type_new = device['.ID_FS_TYPE_NEW']
+ if 'ID_FS_TYPE' in device:
+ fs_type_new = device['ID_FS_TYPE']
if 'LVM' in fs_type_new:
refresh = True
2 years, 6 months
main - configure: update
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5ac4b662df525039eda...
Commit: 5ac4b662df525039eda6a5fc461da60c6ea42c2a
Parent: 67722b312390cdab29c076c912e14bd739c5c0f6
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Mon Apr 26 14:27:05 2021 +0200
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Oct 7 12:42:43 2021 -0500
configure: update
---
configure | 112 +++++++++++++++++++++++++++++++++++++++++++++++++
include/configure.h.in | 3 ++
2 files changed, 115 insertions(+)
diff --git a/configure b/configure
index 8a267d0f1..1f333a6f2 100755
--- a/configure
+++ b/configure
@@ -774,6 +774,10 @@ UDEV_LIBS
UDEV_CFLAGS
SYSTEMD_LIBS
SYSTEMD_CFLAGS
+BLKID_LIBS
+BLKID_CFLAGS
+APP_MACHINEID_LIBS
+APP_MACHINEID_CFLAGS
NOTIFY_DBUS_LIBS
NOTIFY_DBUS_CFLAGS
BLKID_LIBS
@@ -957,6 +961,7 @@ enable_use_lvmpolld
with_lvmpolld_pidfile
enable_dmfilemapd
enable_notify_dbus
+enable_app_machineid
enable_blkid_wiping
enable_udev_systemd_background_jobs
enable_udev_sync
@@ -1027,6 +1032,10 @@ LOCKD_DLM_CONTROL_CFLAGS
LOCKD_DLM_CONTROL_LIBS
LOCKD_IDM_CFLAGS
LOCKD_IDM_LIBS
+NOTIFY_DBUS_CFLAGS
+NOTIFY_DBUS_LIBS
+APP_MACHINEID_CFLAGS
+APP_MACHINEID_LIBS
BLKID_CFLAGS
BLKID_LIBS
NOTIFY_DBUS_CFLAGS
@@ -1691,6 +1700,7 @@ Optional Features:
--disable-use-lvmpolld disable usage of LVM Poll Daemon
--enable-dmfilemapd enable the dmstats filemap daemon
--enable-notify-dbus enable LVM notification using dbus
+ --enable-app-machineid enable LVM system ID using app-specific machine-id
--disable-blkid_wiping disable libblkid detection of signatures when wiping
and use native code instead
--disable-udev-systemd-background-jobs
@@ -1853,6 +1863,13 @@ Some influential environment variables:
C compiler flags for NOTIFY_DBUS, overriding pkg-config
NOTIFY_DBUS_LIBS
linker flags for NOTIFY_DBUS, overriding pkg-config
+ APP_MACHINEID_CFLAGS
+ C compiler flags for APP_MACHINEID, overriding pkg-config
+ APP_MACHINEID_LIBS
+ linker flags for APP_MACHINEID, overriding pkg-config
+ BLKID_CFLAGS
+ C compiler flags for BLKID, overriding pkg-config
+ BLKID_LIBS linker flags for BLKID, overriding pkg-config
SYSTEMD_CFLAGS
C compiler flags for SYSTEMD, overriding pkg-config
SYSTEMD_LIBS
@@ -11637,6 +11654,101 @@ $as_echo "yes" >&6; }
fi
fi
+################################################################################
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build appmachineid" >&5
+$as_echo_n "checking whether to build appmachineid... " >&6; }
+# Check whether --enable-app-machineid was given.
+if test "${enable_app_machineid+set}" = set; then :
+ enableval=$enable_app_machineid; APP_MACHINEID_SUPPORT=$enableval
+else
+ APP_MACHINEID_SUPPORT=no
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $APP_MACHINEID_SUPPORT" >&5
+$as_echo "$APP_MACHINEID_SUPPORT" >&6; }
+
+if test "$APP_MACHINEID_SUPPORT" = yes; then
+
+$as_echo "#define APP_MACHINEID_SUPPORT 1" >>confdefs.h
+
+ SYSTEMD_LIBS="-lsystemd"
+fi
+
+################################################################################
+if test "$APP_MACHINEID_SUPPORT" = yes; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for APP_MACHINEID" >&5
+$as_echo_n "checking for APP_MACHINEID... " >&6; }
+
+if test -n "$APP_MACHINEID_CFLAGS"; then
+ pkg_cv_APP_MACHINEID_CFLAGS="$APP_MACHINEID_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"systemd >= 234\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "systemd >= 234") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_APP_MACHINEID_CFLAGS=`$PKG_CONFIG --cflags "systemd >= 234" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$APP_MACHINEID_LIBS"; then
+ pkg_cv_APP_MACHINEID_LIBS="$APP_MACHINEID_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"systemd >= 234\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "systemd >= 234") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_APP_MACHINEID_LIBS=`$PKG_CONFIG --libs "systemd >= 234" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ APP_MACHINEID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "systemd >= 234" 2>&1`
+ else
+ APP_MACHINEID_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "systemd >= 234" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$APP_MACHINEID_PKG_ERRORS" >&5
+
+ $bailout
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ $bailout
+else
+ APP_MACHINEID_CFLAGS=$pkg_cv_APP_MACHINEID_CFLAGS
+ APP_MACHINEID_LIBS=$pkg_cv_APP_MACHINEID_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ HAVE_APP_MACHINEID=yes
+fi
+fi
+
################################################################################
# Check whether --enable-blkid_wiping was given.
diff --git a/include/configure.h.in b/include/configure.h.in
index 637bfc341..703ac0432 100644
--- a/include/configure.h.in
+++ b/include/configure.h.in
@@ -1,5 +1,8 @@
/* include/configure.h.in. Generated from configure.ac by autoheader. */
+/* Define to 1 to include code that uses libsystemd machine-id apis. */
+#undef APP_MACHINEID_SUPPORT
+
/* Define to 1 to use libblkid detection of signatures when wiping. */
#undef BLKID_WIPING_SUPPORT
2 years, 6 months
main - new udev autoactivation
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=67722b312390cdab29c...
Commit: 67722b312390cdab29c076c912e14bd739c5c0f6
Parent: bbf8e7db74d744c1462a63ae2bc64f4d46e8db9f
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Mar 26 11:39:05 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Oct 7 12:42:31 2021 -0500
new udev autoactivation
new udev rule 69-dm-lvm.rules replaces
69-dm-lvm-meta.rules and lvm2-pvscan.service
udev rule calls pvscan directly on the added device
pvscan output indicates if a complete VG can be activated
udev env var LVM_VG_NAME_COMPLETE is used to pass complete
VG name from pvscan to the udev rule
udev rule uses systemd-run to run vgchange -aay <vgname>
---
scripts/Makefile.in | 1 -
spec/packages.inc | 3 +-
test/shell/udev-pvscan-vgchange.sh | 403 +++++++++++++++++++++++++++++++++++++
udev/69-dm-lvm.rules.in | 87 ++++++++
udev/Makefile.in | 2 +-
5 files changed, 492 insertions(+), 4 deletions(-)
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index ee0acb6f6..0d7f45680 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -92,7 +92,6 @@ install_systemd_generators:
install_systemd_units: install_dbus_service
@echo " [INSTALL] systemd_units"
$(Q) $(INSTALL_DIR) $(systemd_unit_dir)
- $(Q) $(INSTALL_DATA) lvm2-pvscan.service $(systemd_unit_dir)/lvm2-pvscan@.service
ifeq ("@BUILD_DMEVENTD@", "yes")
$(Q) $(INSTALL_DATA) dm_event_systemd_red_hat.socket $(systemd_unit_dir)/dm-event.socket
$(Q) $(INSTALL_DATA) dm_event_systemd_red_hat.service $(systemd_unit_dir)/dm-event.service
diff --git a/spec/packages.inc b/spec/packages.inc
index 3f6e26d11..74d795520 100644
--- a/spec/packages.inc
+++ b/spec/packages.inc
@@ -163,7 +163,7 @@ fi
%endif
%if %{enable_udev}
%{_udevdir}/11-dm-lvm.rules
- %{_udevdir}/69-dm-lvm-metad.rules
+ %{_udevdir}/69-dm-lvm.rules
%endif
%dir %{_sysconfdir}/lvm
%ghost %{_sysconfdir}/lvm/cache/.cache
@@ -189,7 +189,6 @@ fi
%{_tmpfilesdir}/%{name}.conf
%{_unitdir}/blk-availability.service
%{_unitdir}/lvm2-monitor.service
- %{_unitdir}/lvm2-pvscan@.service
%attr(555, -, -) %{_prefix}/lib/systemd/system-generators/lvm2-activation-generator
%if %{have_service lvmpolld}
%{_unitdir}/lvm2-lvmpolld.service
diff --git a/test/shell/udev-pvscan-vgchange.sh b/test/shell/udev-pvscan-vgchange.sh
new file mode 100644
index 000000000..c81acf0ce
--- /dev/null
+++ b/test/shell/udev-pvscan-vgchange.sh
@@ -0,0 +1,403 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2021 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+test_description='udev rule and systemd unit run vgchange'
+
+SKIP_WITH_LVMPOLLD=1
+SKIP_WITH_LVMLOCKD=1
+
+. lib/inittest
+
+#
+# $ cat /tmp/devs
+# /dev/sdb
+# /dev/sdc
+# /dev/sdd
+#
+# Specify this file as LVM_TEST_DEVICE_LIST=/tmp/devs
+# when running the test.
+#
+# This test will wipe these devices.
+#
+
+if [ -z ${LVM_TEST_DEVICE_LIST+x} ]; then echo "LVM_TEST_DEVICE_LIST is unset" && skip; else echo "LVM_TEST_DEVICE_LIST is set to '$LVM_TEST_DEVICE_LIST'"; fi
+
+test -e "$LVM_TEST_DEVICE_LIST" || skip
+
+num_devs=$(cat $LVM_TEST_DEVICE_LIST | wc -l)
+
+RUNDIR="/run"
+test -d "$RUNDIR" || RUNDIR="/var/run"
+PVS_ONLINE_DIR="$RUNDIR/lvm/pvs_online"
+VGS_ONLINE_DIR="$RUNDIR/lvm/vgs_online"
+PVS_LOOKUP_DIR="$RUNDIR/lvm/pvs_lookup"
+
+_clear_online_files() {
+ # wait till udev is finished
+ aux udev_wait
+ rm -f "$PVS_ONLINE_DIR"/*
+ rm -f "$VGS_ONLINE_DIR"/*
+ rm -f "$PVS_LOOKUP_DIR"/*
+}
+
+test -d "$PVS_ONLINE_DIR" || mkdir -p "$PVS_ONLINE_DIR"
+test -d "$VGS_ONLINE_DIR" || mkdir -p "$VGS_ONLINE_DIR"
+test -d "$PVS_LOOKUP_DIR" || mkdir -p "$PVS_LOOKUP_DIR"
+_clear_online_files
+
+aux prepare_real_devs
+
+aux lvmconf 'devices/dir = "/dev"'
+aux lvmconf 'devices/use_devicesfile = 1'
+DFDIR="$LVM_SYSTEM_DIR/devices"
+DF="$DFDIR/system.devices"
+mkdir $DFDIR || true
+not ls $DF
+
+get_real_devs
+
+wipe_all() {
+ for dev in "${REAL_DEVICES[@]}"; do
+ wipefs -a $dev
+ done
+}
+
+# udevadm trigger runs udev rule which runs systemd-run --no-wait vgchange -aay
+# Because of --no-wait, we need to wait for the transient systemd
+# service to be gone before checking the effects of the vgchange.
+
+wait_lvm_activate() {
+ local vgw=$1
+ local wait=0
+
+ while systemctl status lvm-activate-$vgw > /dev/null && test "$wait" -le 30; do
+ sleep .2
+ wait=$(( wait + 1 ))
+ done
+}
+
+# Test requires 3 devs
+test $num_devs -gt 2 || skip
+BDEV1=$(basename "$dev1")
+BDEV2=$(basename "$dev2")
+BDEV3=$(basename "$dev3")
+
+wipe_all
+touch $DF
+for dev in "${REAL_DEVICES[@]}"; do
+ pvcreate $dev
+done
+
+# 1 dev, 1 vg, 1 lv
+
+vgcreate $vg1 "$dev1"
+lvcreate -l1 -an -n $lv1 $vg1 "$dev1"
+
+PVID1=$(pvs "$dev1" --noheading -o uuid | tr -d - | awk '{print $1}')
+
+_clear_online_files
+udevadm trigger --settle -c add /sys/block/$BDEV1
+
+wait_lvm_activate $vg1
+
+ls "$RUNDIR/lvm/pvs_online/$PVID1"
+ls "$RUNDIR/lvm/vgs_online/$vg1"
+journalctl -u lvm-activate-$vg1 | tee out || true
+grep "now active" out
+check lv_field $vg1/$lv1 lv_active "active"
+
+vgchange -an $vg1
+vgremove -y $vg1
+
+
+# 2 devs, 1 vg, 2 lvs
+
+vgcreate $vg2 "$dev1" "$dev2"
+lvcreate -l1 -an -n $lv1 $vg2 "$dev1"
+lvcreate -l1 -an -n $lv2 $vg2 "$dev2"
+
+PVID1=$(pvs "$dev1" --noheading -o uuid | tr -d - | awk '{print $1}')
+PVID2=$(pvs "$dev2" --noheading -o uuid | tr -d - | awk '{print $1}')
+
+_clear_online_files
+
+udevadm trigger --settle -c add /sys/block/$BDEV1
+ls "$RUNDIR/lvm/pvs_online/$PVID1"
+not ls "$RUNDIR/lvm/vgs_online/$vg2"
+journalctl -u lvm-activate-$vg2 | tee out || true
+not grep "now active" out
+check lv_field $vg2/$lv1 lv_active ""
+check lv_field $vg2/$lv2 lv_active ""
+
+udevadm trigger --settle -c add /sys/block/$BDEV2
+ls "$RUNDIR/lvm/pvs_online/$PVID2"
+ls "$RUNDIR/lvm/vgs_online/$vg2"
+
+wait_lvm_activate $vg2
+
+journalctl -u lvm-activate-$vg2 | tee out || true
+grep "now active" out
+check lv_field $vg2/$lv1 lv_active "active"
+check lv_field $vg2/$lv2 lv_active "active"
+
+vgchange -an $vg2
+vgremove -y $vg2
+
+
+# 3 devs, 1 vg, 4 lvs, concurrent pvscans
+# (attempting to have the pvscans run concurrently and race
+# to activate the VG)
+
+vgcreate $vg3 "$dev1" "$dev2" "$dev3"
+lvcreate -l1 -an -n $lv1 $vg3 "$dev1"
+lvcreate -l1 -an -n $lv2 $vg3 "$dev2"
+lvcreate -l1 -an -n $lv3 $vg3 "$dev3"
+lvcreate -l8 -an -n $lv4 -i 2 $vg3 "$dev1" "$dev2"
+
+PVID1=$(pvs "$dev1" --noheading -o uuid | tr -d - | awk '{print $1}')
+PVID2=$(pvs "$dev2" --noheading -o uuid | tr -d - | awk '{print $1}')
+PVID3=$(pvs "$dev3" --noheading -o uuid | tr -d - | awk '{print $1}')
+
+_clear_online_files
+
+udevadm trigger -c add /sys/block/$BDEV1 &
+udevadm trigger -c add /sys/block/$BDEV2 &
+udevadm trigger -c add /sys/block/$BDEV3
+
+aux udev_wait
+wait_lvm_activate $vg3
+
+ls "$RUNDIR/lvm/pvs_online/$PVID1"
+ls "$RUNDIR/lvm/pvs_online/$PVID2"
+ls "$RUNDIR/lvm/pvs_online/$PVID3"
+ls "$RUNDIR/lvm/vgs_online/$vg3"
+journalctl -u lvm-activate-$vg3 | tee out || true
+grep "now active" out
+check lv_field $vg3/$lv1 lv_active "active"
+check lv_field $vg3/$lv2 lv_active "active"
+check lv_field $vg3/$lv3 lv_active "active"
+check lv_field $vg3/$lv4 lv_active "active"
+
+vgchange -an $vg3
+vgremove -y $vg3
+
+
+# 3 devs, 1 vg, 4 lvs, concurrent pvscans, metadata on only 1 PV
+
+wipe_all
+rm $DF
+touch $DF
+pvcreate --metadatacopies 0 "$dev1"
+pvcreate --metadatacopies 0 "$dev2"
+pvcreate "$dev3"
+
+vgcreate $vg4 "$dev1" "$dev2" "$dev3"
+lvcreate -l1 -an -n $lv1 $vg4 "$dev1"
+lvcreate -l1 -an -n $lv2 $vg4 "$dev2"
+lvcreate -l1 -an -n $lv3 $vg4 "$dev3"
+lvcreate -l8 -an -n $lv4 -i 2 $vg4 "$dev1" "$dev2"
+
+PVID1=$(pvs "$dev1" --noheading -o uuid | tr -d - | awk '{print $1}')
+PVID2=$(pvs "$dev2" --noheading -o uuid | tr -d - | awk '{print $1}')
+PVID3=$(pvs "$dev3" --noheading -o uuid | tr -d - | awk '{print $1}')
+
+_clear_online_files
+
+udevadm trigger -c add /sys/block/$BDEV1 &
+udevadm trigger -c add /sys/block/$BDEV2 &
+udevadm trigger -c add /sys/block/$BDEV3
+
+aux udev_wait
+wait_lvm_activate $vg4
+
+ls "$RUNDIR/lvm/pvs_online/$PVID1"
+ls "$RUNDIR/lvm/pvs_online/$PVID2"
+ls "$RUNDIR/lvm/pvs_online/$PVID3"
+ls "$RUNDIR/lvm/vgs_online/$vg4"
+journalctl -u lvm-activate-$vg4 | tee out || true
+grep "now active" out
+check lv_field $vg4/$lv1 lv_active "active"
+check lv_field $vg4/$lv2 lv_active "active"
+check lv_field $vg4/$lv3 lv_active "active"
+check lv_field $vg4/$lv4 lv_active "active"
+
+vgchange -an $vg4
+vgremove -y $vg4
+
+
+# 3 devs, 3 vgs, 2 lvs in each vg, concurrent pvscans
+
+wipe_all
+rm $DF
+touch $DF
+
+vgcreate $vg5 "$dev1"
+vgcreate $vg6 "$dev2"
+vgcreate $vg7 "$dev3"
+lvcreate -l1 -an -n $lv1 $vg5
+lvcreate -l1 -an -n $lv2 $vg5
+lvcreate -l1 -an -n $lv1 $vg6
+lvcreate -l1 -an -n $lv2 $vg6
+lvcreate -l1 -an -n $lv1 $vg7
+lvcreate -l1 -an -n $lv2 $vg7
+
+_clear_online_files
+
+udevadm trigger -c add /sys/block/$BDEV1 &
+udevadm trigger -c add /sys/block/$BDEV2 &
+udevadm trigger -c add /sys/block/$BDEV3
+
+aux udev_wait
+wait_lvm_activate $vg5
+wait_lvm_activate $vg6
+wait_lvm_activate $vg7
+
+ls "$RUNDIR/lvm/vgs_online/$vg5"
+ls "$RUNDIR/lvm/vgs_online/$vg6"
+ls "$RUNDIR/lvm/vgs_online/$vg7"
+journalctl -u lvm-activate-$vg5 | tee out || true
+grep "now active" out
+journalctl -u lvm-activate-$vg6 | tee out || true
+grep "now active" out
+journalctl -u lvm-activate-$vg7 | tee out || true
+grep "now active" out
+check lv_field $vg5/$lv1 lv_active "active"
+check lv_field $vg5/$lv2 lv_active "active"
+check lv_field $vg6/$lv1 lv_active "active"
+check lv_field $vg6/$lv2 lv_active "active"
+check lv_field $vg7/$lv1 lv_active "active"
+check lv_field $vg7/$lv2 lv_active "active"
+
+vgchange -an $vg5
+vgremove -y $vg5
+vgchange -an $vg6
+vgremove -y $vg6
+vgchange -an $vg7
+vgremove -y $vg7
+
+# 3 devs, 1 vg, 1000 LVs
+
+wipe_all
+rm $DF
+touch $DF
+pvcreate --metadatacopies 0 "$dev1"
+pvcreate "$dev2"
+pvcreate "$dev3"
+vgcreate -s 128K $vg8 "$dev1" "$dev2" "$dev3"
+
+# Number of LVs to create
+TEST_DEVS=1000
+# On low-memory boxes let's not stress too much
+test "$(aux total_mem)" -gt 524288 || TEST_DEVS=256
+
+vgcfgbackup -f data $vg8
+
+# Generate a lot of devices (size of 1 extent)
+awk -v TEST_DEVS=$TEST_DEVS '/^\t\}/ {
+ printf("\t}\n\tlogical_volumes {\n");
+ cnt=0;
+ for (i = 0; i < TEST_DEVS; i++) {
+ printf("\t\tlvol%06d {\n", i);
+ printf("\t\t\tid = \"%06d-1111-2222-3333-2222-1111-%06d\"\n", i, i);
+ print "\t\t\tstatus = [\"READ\", \"WRITE\", \"VISIBLE\"]";
+ print "\t\t\tsegment_count = 1";
+ print "\t\t\tsegment1 {";
+ print "\t\t\t\tstart_extent = 0";
+ print "\t\t\t\textent_count = 1";
+ print "\t\t\t\ttype = \"striped\"";
+ print "\t\t\t\tstripe_count = 1";
+ print "\t\t\t\tstripes = [";
+ print "\t\t\t\t\t\"pv0\", " cnt++;
+ printf("\t\t\t\t]\n\t\t\t}\n\t\t}\n");
+ }
+ }
+ {print}
+' data >data_new
+
+vgcfgrestore -f data_new $vg8
+
+_clear_online_files
+
+udevadm trigger -c add /sys/block/$BDEV1 &
+udevadm trigger -c add /sys/block/$BDEV2 &
+udevadm trigger -c add /sys/block/$BDEV3
+
+aux udev_wait
+wait_lvm_activate $vg8
+
+ls "$RUNDIR/lvm/vgs_online/$vg8"
+journalctl -u lvm-activate-$vg8 | tee out || true
+grep "now active" out
+
+num_active=$(lvs $vg8 --noheading -o active | grep active | wc -l)
+
+test $num_active -eq $TEST_DEVS
+
+vgchange -an $vg8
+vgremove -y $vg8
+
+# 1 pv on an md dev, 1 vg
+
+wait_md_create() {
+ local md=$1
+
+ while :; do
+ if ! grep "$(basename $md)" /proc/mdstat; then
+ echo "$md not ready"
+ cat /proc/mdstat
+ sleep 2
+ else
+ break
+ fi
+ done
+ echo "$md" > WAIT_MD_DEV
+}
+
+test -f /proc/mdstat && grep -q raid1 /proc/mdstat || \
+ modprobe raid1 || skip
+
+mddev="/dev/md33"
+not grep $mddev /proc/mdstat || skip
+
+wipe_all
+rm $DF
+touch $DF
+
+mdadm --create --metadata=1.0 "$mddev" --level 1 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
+wait_md_create "$mddev"
+vgcreate $vg9 "$mddev"
+
+PVIDMD=`pvs $mddev --noheading -o uuid | tr -d - | awk '{print $1}'`
+BDEVMD=$(basename "$mddev")
+
+lvcreate -l1 -an -n $lv1 $vg9
+lvcreate -l1 -an -n $lv2 $vg9
+
+_clear_online_files
+
+udevadm trigger --settle -c add /sys/block/$BDEVMD
+
+wait_lvm_activate $vg9
+
+ls "$RUNDIR/lvm/vgs_online/$vg9"
+journalctl -u lvm-activate-$vg9 | tee out || true
+grep "now active" out
+check lv_field $vg9/$lv1 lv_active "active"
+check lv_field $vg9/$lv2 lv_active "active"
+
+vgchange -an $vg9
+vgremove -y $vg9
+
+mdadm --stop "$mddev"
+aux udev_wait
+wipe_all
+
diff --git a/udev/69-dm-lvm.rules.in b/udev/69-dm-lvm.rules.in
new file mode 100644
index 000000000..39e5b9807
--- /dev/null
+++ b/udev/69-dm-lvm.rules.in
@@ -0,0 +1,87 @@
+# Copyright (C) 2012,2021 Red Hat, Inc. All rights reserved.
+#
+# This file is part of LVM.
+#
+# This rule requires blkid to be called on block devices before so only devices
+# used as LVM PVs are processed (ID_FS_TYPE="LVM2_member").
+
+SUBSYSTEM!="block", GOTO="lvm_end"
+(LVM_EXEC_RULE)
+
+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="lvm_end"
+
+# Only process devices already marked as a PV - this requires blkid to be called before.
+ENV{ID_FS_TYPE}!="LVM2_member", GOTO="lvm_end"
+ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="lvm_end"
+ACTION=="remove", GOTO="lvm_end"
+
+# Create /dev/disk/by-id/lvm-pv-uuid-<PV_UUID> symlink for each PV
+ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-id/lvm-pv-uuid-$env{ID_FS_UUID_ENC}"
+
+# If the PV is a special device listed below, scan only if the device is
+# properly activated. These devices are not usable after an ADD event,
+# but they require an extra setup and they are ready after a CHANGE event.
+# Also support coldplugging with ADD event but only if the device is already
+# properly activated.
+# This logic should be eventually moved to rules where those particular
+# devices are processed primarily (MD and loop).
+
+# DM device:
+KERNEL!="dm-[0-9]*", GOTO="next"
+ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", ENV{DM_ACTIVATION}=="1", GOTO="lvm_scan"
+GOTO="lvm_end"
+
+# MD device:
+LABEL="next"
+KERNEL!="md[0-9]*", GOTO="next"
+IMPORT{db}="LVM_MD_PV_ACTIVATED"
+ACTION=="add", ENV{LVM_MD_PV_ACTIVATED}=="1", GOTO="lvm_scan"
+ACTION=="change", ENV{LVM_MD_PV_ACTIVATED}!="1", TEST=="md/array_state", ENV{LVM_MD_PV_ACTIVATED}="1", GOTO="lvm_scan"
+ACTION=="add", KERNEL=="md[0-9]*p[0-9]*", GOTO="lvm_scan"
+ENV{LVM_MD_PV_ACTIVATED}!="1", ENV{SYSTEMD_READY}="0"
+GOTO="lvm_end"
+
+# Loop device:
+LABEL="next"
+KERNEL!="loop[0-9]*", GOTO="next"
+ACTION=="add", ENV{LVM_LOOP_PV_ACTIVATED}=="1", GOTO="lvm_scan"
+ACTION=="change", ENV{LVM_LOOP_PV_ACTIVATED}!="1", TEST=="loop/backing_file", ENV{LVM_LOOP_PV_ACTIVATED}="1", GOTO="lvm_scan"
+ENV{LVM_LOOP_PV_ACTIVATED}!="1", ENV{SYSTEMD_READY}="0"
+GOTO="lvm_end"
+
+LABEL="next"
+ACTION!="add", GOTO="lvm_end"
+
+LABEL="lvm_scan"
+
+ENV{SYSTEMD_READY}="1"
+
+# pvscan will check if this device completes a VG,
+# i.e. all PVs in the VG are now present with the
+# arrival of this PV. If so, it prints to stdout:
+# LVM_VG_NAME_COMPLETE='foo'
+#
+# When the VG is complete it can be activated, so
+# vgchange -aay <vgname> is run. It is run via
+# systemd since it can take longer to run than
+# udev wants to block when processing rules.
+# (if there are hundreds of LVs to activate,
+# the vgchange can take many seconds.)
+#
+# pvscan only reads the single device specified,
+# and uses temp files under /run/lvm to check if
+# other PVs in the VG are present.
+#
+# If event_activation=0 in lvm.conf, this pvscan
+# (using checkcomplete) will do nothing, so that
+# no event-based autoactivation will be happen.
+#
+# TODO: adjust the output of vgchange -aay so that
+# it's better suited to appearing in the journal.
+
+IMPORT{program}="(LVM_EXEC)/lvm pvscan --cache --listvg --checkcomplete --vgonline --udevoutput --journal=output $env{DEVNAME}"
+ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} lvm vgchange -aay --nohints $env{LVM_VG_NAME_COMPLETE}"
+GOTO="lvm_end"
+
+LABEL="lvm_end"
+
diff --git a/udev/Makefile.in b/udev/Makefile.in
index e32cba921..e777dda16 100644
--- a/udev/Makefile.in
+++ b/udev/Makefile.in
@@ -18,7 +18,7 @@ top_builddir = @top_builddir@
include $(top_builddir)/make.tmpl
DM_RULES=10-dm.rules 13-dm-disk.rules 95-dm-notify.rules
-LVM_RULES=11-dm-lvm.rules 69-dm-lvm-metad.rules
+LVM_RULES=11-dm-lvm.rules 69-dm-lvm.rules
DM_DIR=$(shell $(GREP) "\#define DM_DIR" $(top_srcdir)/libdm/misc/dm-ioctl.h | $(AWK) '{print $$3}')
2 years, 6 months
main - logging: to the systemd journal
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bbf8e7db74d744c1462...
Commit: bbf8e7db74d744c1462a63ae2bc64f4d46e8db9f
Parent: 0b6782fa0139e412f827cc9d1f0cd96ea38e27b0
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Mar 24 14:19:54 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Oct 7 12:06:49 2021 -0500
logging: to the systemd journal
Configure via lvm.conf log/journal or command line --journal.
Possible values:
"command" records command information.
"output" records default command output.
"debug" records full command debugging.
Multiple values can be set in lvm.conf as an array.
One value can be set in --journal which is added to
values set in lvm.conf
---
lib/commands/toolcontext.c | 30 +++++++++++++++
lib/commands/toolcontext.h | 1 +
lib/config/config_settings.h | 6 +++
lib/log/log.c | 91 ++++++++++++++++++++++++++++++++++++++++++++
lib/log/log.h | 4 ++
lib/log/lvm-logging.h | 6 +++
tools/args.h | 8 ++++
tools/command-lines.in | 2 +-
tools/lvmcmdline.c | 12 ++++++
9 files changed, 159 insertions(+), 1 deletion(-)
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 8991aebcf..f939c3e76 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -340,6 +340,33 @@ static int _parse_debug_classes(struct cmd_context *cmd)
return debug_classes;
}
+static uint32_t _parse_log_journal(struct cmd_context *cmd, int cfg, const char *cfgname)
+{
+ const struct dm_config_node *cn;
+ const struct dm_config_value *cv;
+ uint32_t fields = 0;
+ uint32_t val;
+
+ if (!(cn = find_config_tree_array(cmd, cfg, NULL))) {
+ log_debug("Unable to find configuration for log/%s.", cfgname);
+ return 0;
+ }
+
+ for (cv = cn->v; cv; cv = cv->next) {
+ if (cv->type != DM_CFG_STRING) {
+ log_verbose("log/%s contains a value which is not a string. Ignoring.", cfgname);
+ continue;
+ }
+
+ if ((val = log_journal_str_to_val(cv->v.str)))
+ fields |= val;
+ else
+ log_verbose("Unrecognised value for log/%s: %s", cfgname, cv->v.str);
+ }
+
+ return fields;
+}
+
static void _init_logging(struct cmd_context *cmd)
{
int append = 1;
@@ -408,6 +435,9 @@ static void _init_logging(struct cmd_context *cmd)
init_debug_file_fields(_parse_debug_fields(cmd, log_debug_file_fields_CFG, "debug_file_fields"));
init_debug_output_fields(_parse_debug_fields(cmd, log_debug_output_fields_CFG, "debug_output_fields"));
+ cmd->default_settings.journal = _parse_log_journal(cmd, log_journal_CFG, "journal");
+ init_log_journal(cmd->default_settings.journal);
+
t = time(NULL);
ctime_r(&t, &timebuf[0]);
timebuf[24] = '\0';
diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h
index 731cc7ee0..7ccee4571 100644
--- a/lib/commands/toolcontext.h
+++ b/lib/commands/toolcontext.h
@@ -42,6 +42,7 @@ struct config_info {
int udev_sync;
int udev_fallback;
int issue_discards;
+ uint32_t journal;
const char *msg_prefix;
const char *fmt_name;
const char *dmeventd_executable;
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index aad0d5989..d280e7adb 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -873,6 +873,12 @@ cfg(log_syslog_CFG, "syslog", log_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_B
cfg(log_file_CFG, "file", log_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, 0, NULL,
"Write error and debug log messages to a file specified here.\n")
+cfg_array(log_journal_CFG, "journal", log_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, NULL, vsn(2, 3, 12), NULL, 0, NULL,
+ "Record lvm information in the systemd journal.\n"
+ "command: record commands that are run.\n"
+ "output: record default output from commands.\n"
+ "debug: record debug messages from commands.\n")
+
cfg(log_overwrite_CFG, "overwrite", log_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_OVERWRITE, vsn(1, 0, 0), NULL, 0, NULL,
"Overwrite the log file each time the program is run.\n")
diff --git a/lib/log/log.c b/lib/log/log.c
index 53ff5b156..8ebbf947a 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -25,6 +25,7 @@
#include <syslog.h>
#include <ctype.h>
#include <time.h>
+#include <systemd/sd-journal.h>
static FILE *_log_file;
static char _log_file_path[PATH_MAX];
@@ -40,6 +41,7 @@ static char _msg_prefix[30] = " ";
static int _abort_on_internal_errors_config = 0;
static uint32_t _debug_file_fields;
static uint32_t _debug_output_fields;
+static uint32_t _log_journal = 0;
static lvm2_log_fn_t _lvm2_log_fn = NULL;
@@ -455,6 +457,11 @@ void init_debug_output_fields(uint32_t debug_fields)
_debug_output_fields = debug_fields;
}
+void init_log_journal(uint32_t fields)
+{
+ _log_journal = fields;
+}
+
static void _set_time_prefix(char *prefix, int buflen)
{
@@ -609,6 +616,33 @@ static void _vprint_log(int level, const char *file, int line, int dm_errno_or_c
}
log_it:
+
+ if (_log_journal) {
+ int to_journal = 0;
+
+ /* By default the visible command output is _LOG_WARN or less. */
+
+ if (_log_journal & LOG_JOURNAL_DEBUG)
+ to_journal = 1;
+ if ((_log_journal & LOG_JOURNAL_OUTPUT) && (log_level(level) <= _LOG_WARN))
+ to_journal = 1;
+
+ if (to_journal) {
+ int prio;
+ switch (log_level(level)) {
+ case _LOG_ERR: prio = LOG_ERR; break;
+ case _LOG_WARN: prio = LOG_WARNING; break;
+ case _LOG_INFO: prio = LOG_INFO; break;
+ case _LOG_NOTICE: prio = LOG_NOTICE; break;
+ case _LOG_DEBUG: prio = LOG_DEBUG; break;
+ default: prio = LOG_INFO;
+ }
+ va_copy(ap, orig_ap);
+ sd_journal_printv(prio, trformat, ap);
+ va_end(ap);
+ }
+ }
+
if (!logged_via_report && ((verbose_level() >= level) && !_log_suppress)) {
if (verbose_level() > _LOG_DEBUG) {
memset(buf, 0, sizeof(buf));
@@ -792,3 +826,60 @@ void log_set_report_object_name_and_id(const char *name, const char *id)
_log_report.object_name = name;
_log_report.object_id = id;
}
+
+/*
+ * TODO: log/journal=["daemon_command"]
+ * daemon_command: record commands that are run by an lvm daemon.
+ * (i.e. not commands run directly by a user.)
+ * For this we need to be able to clearly identify when a command is
+ * being run by dmeventd/lvmpolld/lvmdbusd.
+ *
+ * TODO: log/journal_commmand_names=["lvcreate","lvconvert"]
+ * This would restrict log/journal=["command"] to the listed command names.
+ * Also allow "!command" to exclude a command, e.g. ["!pvs"]
+ *
+ * TODO: log/journal_daemon_command_names=["lvcreate","lvconvert"]
+ * This would restrict log/journal=["dameon_command"] to the listed command names.
+ *
+ * TODO: log/journal_daemon_names=["dmeventd"]
+ * This would restrict log/journal=["daemon_command"] to commands run by
+ * the named daemon.
+ *
+ * TODO: log/command_to_file=<path> would write this info to the file.
+ *
+ * TODO: log/debug_to_file=<path> would write full debugging to the file.
+ * (the same effect as log/file=<path> log/level=7)
+ */
+
+void log_command(const char *cmd_line, const char *cmd_name, const char *cmd_id)
+{
+ if (_log_journal & LOG_JOURNAL_COMMAND) {
+
+ /*
+ * TODO: DAEMON=dmeventd|lvmpolld|lvmdbusd,
+ * Could we include caller info such as libblkid, udev rule, etc?
+ * Does systemd already record the caller for us?
+ */
+
+ /* The command line, pid, and other things are automatically included. */
+
+ sd_journal_send("MESSAGE=lvm command %s", cmd_name,
+ "MESSAGE_ID=3ca432788c374e4ba684b834188eca36",
+ "LVM_CMD_NAME=%s", cmd_name,
+ "LVM_CMD_ID=%s", cmd_id,
+ "PRIORITY=%i", LOG_INFO,
+ NULL);
+ }
+}
+
+uint32_t log_journal_str_to_val(const char *str)
+{
+ if (!strcasecmp(str, "command"))
+ return LOG_JOURNAL_COMMAND;
+ if (!strcasecmp(str, "output"))
+ return LOG_JOURNAL_OUTPUT;
+ if (!strcasecmp(str, "debug"))
+ return LOG_JOURNAL_DEBUG;
+ return 0;
+}
+
diff --git a/lib/log/log.h b/lib/log/log.h
index d3848a4f0..b5f05f29b 100644
--- a/lib/log/log.h
+++ b/lib/log/log.h
@@ -63,6 +63,10 @@
#define LOG_DEBUG_FIELD_FILELINE 0x0004
#define LOG_DEBUG_FIELD_MESSAGE 0x0008
+#define LOG_JOURNAL_COMMAND 0x0001
+#define LOG_JOURNAL_OUTPUT 0x0002
+#define LOG_JOURNAL_DEBUG 0x0004
+
/*
* Classes available for debug log messages.
diff --git a/lib/log/lvm-logging.h b/lib/log/lvm-logging.h
index 39108fc60..fb18a4159 100644
--- a/lib/log/lvm-logging.h
+++ b/lib/log/lvm-logging.h
@@ -62,6 +62,12 @@ void reset_log_duplicated(void);
void init_syslog(int facility);
void fin_syslog(void);
+void init_log_journal(uint32_t fields);
+uint32_t log_journal_str_to_val(const char *str);
+
+void log_command(const char *cmd_line, const char *cmd_name, const char *cmd_id);
+
+
int error_message_produced(void);
void reset_lvm_errno(int store_errmsg);
int stored_errno(void);
diff --git a/tools/args.h b/tools/args.h
index 8ce176739..774ce33f4 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -323,6 +323,14 @@ arg(ignoreunsupported_ARG, '\0', "ignoreunsupported", 0, 0, 0,
arg(importdevices_ARG, '\0', "importdevices", 0, 0, 0,
"Add devices to the devices file.\n")
+arg(journal_ARG, '\0', "journal", string_VAL, 0, 0,
+ "Record information in the systemd journal.\n"
+ "This information is in addition to information\n"
+ "enabled by the lvm.conf log/journal setting.\n"
+ "command: record information about the command.\n"
+ "output: record the default command output.\n"
+ "debug: record full command debugging.\n")
+
arg(labelsector_ARG, '\0', "labelsector", number_VAL, 0, 0,
"By default the PV is labelled with an LVM2 identifier in its second\n"
"sector (sector 1). This lets you use a different sector near the\n"
diff --git a/tools/command-lines.in b/tools/command-lines.in
index 332ad8a3b..10b23e75d 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -204,7 +204,7 @@
#
OO_ALL: --commandprofile String, --config String, --debug,
--driverloaded Bool, --help, --nolocking, --lockopt String, --longhelp, --profile String, --quiet,
---verbose, --version, --yes, --test, --devicesfile String, --devices PV, --nohints
+--verbose, --version, --yes, --test, --devicesfile String, --devices PV, --nohints --journal String
#
# options for pvs, lvs, vgs, fullreport
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index d82c374c6..1e12bedca 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -2017,6 +2017,8 @@ out:
log_debug("Recognised command %s (id %d / enum %d).",
commands[best_i].command_id, best_i, commands[best_i].command_enum);
+ log_command(cmd->cmd_line, commands[best_i].name, commands[best_i].command_id);
+
return &commands[best_i];
}
@@ -2405,6 +2407,15 @@ static void _get_current_output_settings_from_args(struct cmd_context *cmd)
cmd->current_settings.verbose = 0;
cmd->current_settings.silent = (arg_count(cmd, quiet_ARG) > 1) ? 1 : 0;
}
+
+ /*
+ * default_settings.journal is already set from config and has already been
+ * applied using init_log_journal().
+ * current_settings have been set to default_settings.
+ * now --journal value adds to current_settings.
+ */
+ if (arg_is_set(cmd, journal_ARG))
+ cmd->current_settings.journal |= log_journal_str_to_val(arg_str_value(cmd, journal_ARG, ""));
}
static void _apply_current_output_settings(struct cmd_context *cmd)
@@ -2414,6 +2425,7 @@ static void _apply_current_output_settings(struct cmd_context *cmd)
init_debug_classes_logged(cmd->default_settings.debug_classes);
init_verbose(cmd->current_settings.verbose + VERBOSE_BASE_LEVEL);
init_silent(cmd->current_settings.silent);
+ init_log_journal(cmd->current_settings.journal);
}
static int _read_devices_list(struct cmd_context *cmd)
2 years, 6 months