mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-02 13:47:42 +03:00
234b12480e
Switch lvconvert's --merge code over to using process_each_lv(). Doing so adds support for a single 'lvconvert --merge' to start merging multiple LVs (which includes @tag expansion). Add 'lvconvert --merge @tag' testing to test/t-snapshot-merge.sh Adjust man/lvconvert.8.in to reflect these expanded capabilities. The lvconvert.c implementation requires rereading the VG each iteration of process_each_lv(). Otherwise a stale VG instance associated with the LV passed to lvconvert_single_merge() would result in stale VG metadata being written back out to disk. This overwrote new metadata that was written when a previous snapshot LV finished merging (via lvconvert_poll). This is only an issue when merging multiple LVs that share the same VG (a single VG is typical for most LVM configurations on system disks). In the end this new support is very useful for performing a "system rollback" that requires multiple snapshot LVs be merged to their respective origin LV. The yum-utils 'fs-snapshot' plugin tags all snapshot LVs that it creates with a common 'snapshot_tag' that is unique to the yum transaction. Rolling back a yum transaction, that created LVM snapshots with the tag 'yum_20100129133223', is as simple as: lvconvert --merge @yum_20100129133223 Signed-off-by: Mike Snitzer <snitzer@redhat.com>