diff options
author | David Teigland <teigland@redhat.com> | 2016-04-28 09:37:03 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2016-05-23 11:57:32 -0500 |
commit | 9b640c36841e2790731d54a5830dcea8203f9e80 (patch) | |
tree | e80a1131588a48b342276ddee5c3ec5795a54155 /tools/vgscan.c | |
parent | 55683a659f9bf6875dd930e2dff62f1e1bdb88aa (diff) | |
download | lvm2-9b640c36841e2790731d54a5830dcea8203f9e80.tar.gz |
pvscan: use process_each_vg for autoactivate
This refactors the code for autoactivation. Previously,
as each PV was found, it would be sent to lvmetad, and
the VG would be autoactivated using a non-standard VG
processing function (the "activation_handler") called via
a function pointer from within the lvmetad notification path.
Now, any scanning that the command needs to do (scanning
only the named device args, or scanning all devices when
there are no args), is done first, before any activation
is attempted. During the scans, the VG names are saved.
After scanning is complete, process_each_vg is used to do
autoactivation of the saved VG names. This makes pvscan
activation much more similar to activation done with
vgchange or lvchange.
The separate autoactivate phase also means that if lvmetad
is disabled (either before or during the scan), the command
can continue with the activation step by simply not using
lvmetad and reverting to disk scanning to do the
activation.
Diffstat (limited to 'tools/vgscan.c')
-rw-r--r-- | tools/vgscan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/vgscan.c b/tools/vgscan.c index 67797f52a..688e361a9 100644 --- a/tools/vgscan.c +++ b/tools/vgscan.c @@ -101,7 +101,7 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv) log_verbose("Ignoring vgscan --cache command because lvmetad is not in use."); if (lvmetad_used() && (arg_is_set(cmd, cache_long_ARG) || !lvmetad_token_matches(cmd) || lvmetad_is_disabled(cmd, &reason))) { - if (lvmetad_used() && !lvmetad_pvscan_all_devs(cmd, NULL, arg_is_set(cmd, cache_long_ARG))) { + if (lvmetad_used() && !lvmetad_pvscan_all_devs(cmd, arg_is_set(cmd, cache_long_ARG))) { log_warn("WARNING: Not using lvmetad because cache update failed."); lvmetad_make_unused(cmd); } |