diff options
author | Petr Rockai <prockai@redhat.com> | 2012-09-10 16:35:43 +0200 |
---|---|---|
committer | Petr Rockai <prockai@redhat.com> | 2012-09-26 17:26:23 +0200 |
commit | e7d3553906f15b9117d0152844f69de33564ab46 (patch) | |
tree | 437f516d2732acfab73df54bf27753c1802783bc | |
parent | 2d7a8b453196893186ae3eb61dc31c1df8b1cf6f (diff) | |
download | lvm2-e7d3553906f15b9117d0152844f69de33564ab46.tar.gz lvm2-e7d3553906f15b9117d0152844f69de33564ab46.tar.xz lvm2-e7d3553906f15b9117d0152844f69de33564ab46.zip |
lvmetad: Make vgscan --cache an alias to pvscan --cache.
-rw-r--r-- | tools/vgscan.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/tools/vgscan.c b/tools/vgscan.c index 8deafb64..99124ef1 100644 --- a/tools/vgscan.c +++ b/tools/vgscan.c @@ -15,8 +15,6 @@ #include "tools.h" -static int _lvmetad; - static int vgscan_single(struct cmd_context *cmd, const char *vg_name, struct volume_group *vg, void *handle __attribute__((unused))) @@ -27,12 +25,6 @@ static int vgscan_single(struct cmd_context *cmd, const char *vg_name, check_current_backup(vg); - /* keep lvmetad up to date, restore the "active" state temporarily */ - lvmetad_set_active(_lvmetad); - if (!lvmetad_vg_update(vg)) - stack; - lvmetad_set_active(0); - return ECMD_PROCESSED; } @@ -54,10 +46,11 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv) cmd->filter->wipe(cmd->filter); lvmcache_destroy(cmd, 1); - _lvmetad = lvmetad_active(); if (arg_count(cmd, cache_ARG)) { - if (_lvmetad) - lvmetad_set_active(0); /* do not rely on lvmetad info */ + if (lvmetad_active()) { + if (!lvmetad_pvscan_all_devs(cmd, NULL)) + return ECMD_FAILED; + } else { log_error("Cannot proceed since lvmetad is not active."); unlock_vg(cmd, VG_GLOBAL); @@ -76,7 +69,6 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv) maxret = ret; } - lvmetad_set_active(_lvmetad); /* restore */ unlock_vg(cmd, VG_GLOBAL); return maxret; } |