summaryrefslogtreecommitdiffstats
path: root/tools/pvscan.c
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2012-02-23 13:11:07 +0000
committerPetr Rockai <prockai@redhat.com>2012-02-23 13:11:07 +0000
commitdae0822698327e81f467c3594141d70cdafca331 (patch)
tree673c87128df8e56be79703a799c83d12acbe5b19 /tools/pvscan.c
parent182d1f60d2fb1bbadef2974fa55278f553b04ed9 (diff)
downloadlvm2-dae0822698327e81f467c3594141d70cdafca331.tar.gz
lvm2-dae0822698327e81f467c3594141d70cdafca331.tar.xz
lvm2-dae0822698327e81f467c3594141d70cdafca331.zip
The lvmetad client-side integration. Only active when use_lvmetad = 1 is set in
lvm.conf *and* lvmetad is running.
Diffstat (limited to 'tools/pvscan.c')
-rw-r--r--tools/pvscan.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/pvscan.c b/tools/pvscan.c
index b40be6db..42d49402 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -15,6 +15,9 @@
#include "tools.h"
+#include "lvmetad.h"
+#include "lvmcache.h"
+
int pv_max_name_len = 0;
int vg_max_name_len = 0;
@@ -96,8 +99,7 @@ static void _pvscan_display_single(struct cmd_context *cmd,
pv_pe_size(pv)));
}
-int pvscan(struct cmd_context *cmd, int argc __attribute__((unused)),
- char **argv __attribute__((unused)))
+int pvscan(struct cmd_context *cmd, int argc, char **argv)
{
int new_pvs_found = 0;
int pvs_found = 0;
@@ -113,6 +115,12 @@ int pvscan(struct cmd_context *cmd, int argc __attribute__((unused)),
pv_max_name_len = 0;
vg_max_name_len = 0;
+ if (arg_count(cmd, lvmetad_ARG)) {
+ if (!pvscan_lvmetad(cmd, argc, argv))
+ return ECMD_FAILED;
+ return ECMD_PROCESSED;
+ }
+
if (arg_count(cmd, novolumegroup_ARG) && arg_count(cmd, exported_ARG)) {
log_error("Options -e and -n are incompatible");
return EINVALID_CMD_LINE;
@@ -184,8 +192,8 @@ int pvscan(struct cmd_context *cmd, int argc __attribute__((unused)),
vg_max_name_len += 2;
dm_list_iterate_items(pvl, pvslist) {
- _pvscan_display_single(cmd, pvl->pv, NULL);
- free_pv_fid(pvl->pv);
+ _pvscan_display_single(cmd, pvl->pv, NULL);
+ free_pv_fid(pvl->pv);
}
if (!pvs_found) {