"lvscan " "\n"
"\t[-a|--all]\n"
"\t[-b|--blockdevice] " "\n"
+ "\t[--cache]\n"
"\t[--commandprofile ProfileName]\n"
"\t[-d|--debug] " "\n"
"\t[-h|-?|--help] " "\n"
"\t[--version]\n",
all_ARG, blockdevice_ARG, ignorelockingfailure_ARG, partial_ARG,
- readonly_ARG)
+ readonly_ARG, cache_ARG)
xx(pvchange,
"Change attributes of physical volume(s)",
#include "tools.h"
+static int _lvscan_single_lvmetad(struct cmd_context *cmd, struct logical_volume *lv)
+{
+ struct pv_list *pvl;
+ struct dm_list pvs;
+
+ if (!lvmetad_used()) {
+ log_verbose("Ignoring lvscan --cache because lvmetad is not in use.");
+ return ECMD_PROCESSED;
+ }
+
+ dm_list_init(&pvs);
+
+ if (!get_pv_list_for_lv(lv->vg->vgmem, lv, &pvs))
+ return ECMD_FAILED;
+
+ dm_list_iterate_items(pvl, &pvs)
+ if (!lvmetad_pvscan_single(cmd, pvl->pv->dev, NULL))
+ return ECMD_FAILED;
+
+ return ECMD_PROCESSED;
+}
+
static int lvscan_single(struct cmd_context *cmd, struct logical_volume *lv,
void *handle __attribute__((unused)))
{
const char *active_str, *snapshot_str;
+ if (arg_count(cmd, cache_ARG))
+ return _lvscan_single_lvmetad(cmd, lv);
+
if (!arg_count(cmd, all_ARG) && !lv_is_visible(lv))
return ECMD_PROCESSED;
int lvscan(struct cmd_context *cmd, int argc, char **argv)
{
- if (argc) {
+ if (argc && !arg_count(cmd, cache_ARG)) {
log_error("No additional command line arguments allowed");
return EINVALID_CMD_LINE;
}