1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-19 14:04:17 +03:00

lvmetad: Make vgscan --cache an alias to pvscan --cache.

This commit is contained in:
Petr Rockai 2012-09-10 16:35:43 +02:00
parent 2d7a8b4531
commit e7d3553906

View File

@ -15,8 +15,6 @@
#include "tools.h" #include "tools.h"
static int _lvmetad;
static int vgscan_single(struct cmd_context *cmd, const char *vg_name, static int vgscan_single(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg, struct volume_group *vg,
void *handle __attribute__((unused))) void *handle __attribute__((unused)))
@ -27,12 +25,6 @@ static int vgscan_single(struct cmd_context *cmd, const char *vg_name,
check_current_backup(vg); 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; return ECMD_PROCESSED;
} }
@ -54,10 +46,11 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv)
cmd->filter->wipe(cmd->filter); cmd->filter->wipe(cmd->filter);
lvmcache_destroy(cmd, 1); lvmcache_destroy(cmd, 1);
_lvmetad = lvmetad_active();
if (arg_count(cmd, cache_ARG)) { if (arg_count(cmd, cache_ARG)) {
if (_lvmetad) if (lvmetad_active()) {
lvmetad_set_active(0); /* do not rely on lvmetad info */ if (!lvmetad_pvscan_all_devs(cmd, NULL))
return ECMD_FAILED;
}
else { else {
log_error("Cannot proceed since lvmetad is not active."); log_error("Cannot proceed since lvmetad is not active.");
unlock_vg(cmd, VG_GLOBAL); unlock_vg(cmd, VG_GLOBAL);
@ -76,7 +69,6 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv)
maxret = ret; maxret = ret;
} }
lvmetad_set_active(_lvmetad); /* restore */
unlock_vg(cmd, VG_GLOBAL); unlock_vg(cmd, VG_GLOBAL);
return maxret; return maxret;
} }