1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00
lvm2/tools
David Teigland db741e75a2 pvscan: autoactivate without lvmetad
When lvmetad is not used, use temporary files to record
which PVs have appeared.  Use these temp files to determine
when a VG is complete, to trigger autoactivation.

This change allows us to remove lvmetad while keeping the
same autoactivation behavior that lvmetad provides.

The temp files are created in /run/lvm/pvs_online/ and are
named for the PVID of the PV.  The files contain the
major:minor of the device the PV was read from.

e.g. if VG foo has dev1 and dev2, then:

. pvscan --cache -aay dev1
  reads vg metadata from dev1
  creates /run/lvm/pvs_online/<pvid-of-dev1>
  checks if all vg->pvs are online: no

. pvscan --cache -aay dev2
  reads vg metadata from dev2
  creates /run/lvm/pvs_online/<pvid-of-dev2>
  checks if all vg->pvs are online: yes
  autoactivates vg

A 'pvscan --cache dev' (without -aay) still records that
dev is online.

A 'pvscan --cache --major X --minor Y' after a device is
gone will remove the temp file for it.

A 'pvscan --cache [-aay]' (no devs) resets the state of
temp files by removing them all, then scanning all devs
and creating temp files for PVs that are found.

If no online files exist, the first pvscan --cache scans
all devs and creates temp files for any PVs found.

The scope of the temp files is only pvscan, and they are only
used for pvscan-based autoactivation.  No other commands are
concerned with or aware of these temp files.  When lvm creates
or removes PVs, no attempt is made to update the temp files.
2018-07-09 16:11:24 -05:00
..
.exported_symbols generate liblvm2cmd exported symbols too 2010-06-25 18:23:10 +00:00
.gitignore tools: add generated headers to .gitignore 2017-03-10 13:13:41 +00:00
args.h args: new options for vdo segment 2018-07-09 15:28:35 +02:00
cmdnames.h doc: change fsf address 2016-01-21 12:11:37 +01:00
command-lines.in lvconvert: support to convert lv into vdopool 2018-07-09 15:29:16 +02:00
command.c man-generator: drop macro redefines 2018-06-14 23:22:42 +02:00
command.h cleanup: fix some typos 2017-07-10 14:58:33 +02:00
commands.h scan: skip device rescan in vg_read 2018-04-20 11:23:14 -05:00
dumpconfig.c lvmconfig: Add options to produce file preamble 2017-08-05 16:23:34 +01:00
errors.h tools: Introduce exit code EINIT_FAILED. 2017-07-26 23:18:03 +01:00
formats.c doc: change fsf address 2016-01-21 12:11:37 +01:00
license.inc pre-release 2017-03-28 16:11:35 +01:00
lv_props.h commands: new method for defining commands 2017-02-13 08:20:10 -06:00
lv_types.h toollib: support new command rules queries 2018-07-09 15:28:35 +02:00
lvchange.c lvchange: vdo support compression deduplication change 2018-07-09 15:29:15 +02:00
lvconvert_poll.c debug: more display_lvname usage 2017-06-27 08:28:36 +02:00
lvconvert_poll.h build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lvconvert.c lvconvert: support to convert lv into vdopool 2018-07-09 15:29:16 +02:00
lvcreate.c lvcreate: vdo support 2018-07-09 15:29:12 +02:00
lvdisplay.c process_each_lv: add check_single_lv function 2017-02-13 08:20:10 -06:00
lvextend.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm2cmd-static.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lvm2cmd.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lvm2cmd.h tools: Introduce exit code EINIT_FAILED. 2017-07-26 23:18:03 +01:00
lvm2cmdline.h commands: fix memory debug for cmd defs 2017-05-01 15:27:14 -05:00
lvm-static.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvm.c debug: tracing error path 2017-06-27 00:27:36 +02:00
lvmcmdlib.c dmeventd: lvm vdo support 2018-07-09 15:29:16 +02:00
lvmcmdline.c lvconvert: support to convert lv into vdopool 2018-07-09 15:29:16 +02:00
lvmdiskscan.c Add cmd arg to more functions 2018-06-15 11:03:55 -05:00
lvpoll.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
lvreduce.c doc: change fsf address 2016-01-21 12:11:37 +01:00
lvremove.c process_each_lv: add check_single_lv function 2017-02-13 08:20:10 -06:00
lvrename.c toollib: make it possible to also process internal VGs, add 'include_internal' switch to process_each_vg fn 2016-06-20 11:33:42 +02:00
lvresize.c lvresize: support passing --yes to fsadm 2017-06-21 14:03:29 +02:00
lvscan.c tidy: Add missing underscores to statics. 2017-10-18 15:58:13 +01:00
Makefile.in dmsetup: move to libdm/dm-tools/dmsetup 2018-06-14 13:10:17 +01:00
polldaemon.c Remove unused clvm variations for active LVs 2018-06-07 16:17:04 +01:00
pvchange.c lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00
pvck.c Add cmd arg to more functions 2018-06-15 11:03:55 -05:00
pvcreate.c filter: use bcache for filter reads 2018-05-10 16:03:19 -05:00
pvdisplay.c lvmetad: two phase vg_update 2016-06-28 02:30:31 +01:00
pvmove_poll.c pvmove: move code from tools to lib 2017-12-01 12:18:32 +01:00
pvmove_poll.h doc: change fsf address 2016-01-21 12:11:37 +01:00
pvmove.c Remove unused clvm variations for active LVs 2018-06-07 16:17:04 +01:00
pvremove.c pvremove: skip lvmlockd locks for forced clearing 2018-05-30 09:25:45 -05:00
pvresize.c pvresize: update message 2018-06-08 14:36:59 +02:00
pvscan.c pvscan: autoactivate without lvmetad 2018-07-09 16:11:24 -05:00
reporter.c Add cmd arg to more functions 2018-06-15 11:03:55 -05:00
segtypes.c doc: change fsf address 2016-01-21 12:11:37 +01:00
stub.h Remove vgconvert 2018-06-13 14:14:03 -05:00
tags.c doc: change fsf address 2016-01-21 12:11:37 +01:00
tool.h various: some missing #include zalloc.h 2018-06-08 14:18:09 +01:00
toollib.c toollib: support new command rules queries 2018-07-09 15:28:35 +02:00
toollib.h build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
tools.h lvconvert: support to convert lv into vdopool 2018-07-09 15:29:16 +02:00
vals.h Remove lvm1 and pool disk formats 2018-04-30 16:55:02 -05:00
vgcfgbackup.c device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
vgcfgrestore.c vcfgrestore: add prompt with active volumes 2018-06-22 23:37:36 +02:00
vgchange.c vgchange: vdo support 2018-07-09 15:29:16 +02:00
vgck.c toollib: make it possible to also process internal VGs, add 'include_internal' switch to process_each_vg fn 2016-06-20 11:33:42 +02:00
vgcreate.c Remove clvmd and associated code 2018-06-05 11:09:13 -05:00
vgdisplay.c tidy: Add missing underscores to statics. 2017-10-18 15:58:13 +01:00
vgexport.c lvmlockd: primarily use vg_is_shared 2018-06-01 13:15:22 -05:00
vgextend.c filter: use bcache for filter reads 2018-05-10 16:03:19 -05:00
vgimport.c lvmlockd: primarily use vg_is_shared 2018-06-01 13:15:22 -05:00
vgimportclone.c Remove VG lock ordering check 2018-06-07 16:17:04 +01:00
vgmerge.c Remove unused cache management from locking 2018-06-08 12:30:43 -05:00
vgmknodes.c process_each_lv: add check_single_lv function 2017-02-13 08:20:10 -06:00
vgreduce.c Fix use of orphan lock in commands 2018-06-12 09:46:11 -05:00
vgremove.c Fix use of orphan lock in commands 2018-06-12 09:46:11 -05:00
vgrename.c Remove unused cache management from locking 2018-06-08 12:30:43 -05:00
vgscan.c Remove lvm1 and pool disk formats 2018-04-30 16:55:02 -05:00
vgsplit.c Fix use of orphan lock in commands 2018-06-12 09:46:11 -05:00