1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00
Zdenek Kabelac e8a40f6571 Allow to activate snapshot
Add extra code to active and deactivate related
snapshots and origin when user specifies snapshot
logical volume as lvchange parameter.

Before patch:

$> lvs -a
  LV    VG   Attr     LSize  Pool Origin Snap%  Move Log Copy%  Convert
  lvol0 mvg  owi-a-s-  1.00k
  lvol1 mvg  swi-a-s- 16.00k      lvol0    0.00
  lvol2 mvg  swi-a-s- 16.00k      lvol0    0.00

$> lvchange -an mvg/lvol2; echo $?
  Can't change snapshot logical volume "lvol2".
5

After patch:

$> lvchange -an mvg/lvol2
Change of snapshot lvol2 will also change its origin lvol0 and 1 other
snapshot(s). Proceed? [y/n]: n
  Logical volume lvol2 not changed.

$> lvchange -y -an mvg/lvol2; echo $?
0

$> lvs -a
  LV    VG   Attr     LSize  Pool Origin Snap%  Move Log Copy%  Convert
  lvol0 mvg  owi---s-  1.00k
  lvol1 mvg  swi---s- 16.00k      lvol0
  lvol2 mvg  swi---s- 16.00k      lvol0
2011-11-18 19:22:49 +00:00
..
2011-11-04 22:43:10 +00:00
2011-11-18 19:22:49 +00:00
2011-11-10 12:43:05 +00:00
2008-01-30 14:00:02 +00:00
2011-11-12 22:44:10 +00:00
2011-09-16 12:10:02 +00:00
2008-01-30 14:00:02 +00:00
2011-08-10 20:25:29 +00:00
2011-08-10 20:25:29 +00:00
2011-10-11 08:51:02 +00:00
2011-08-10 20:25:29 +00:00
2011-08-10 20:25:29 +00:00
2011-02-18 14:47:28 +00:00
2011-02-18 14:47:28 +00:00
2010-07-27 20:05:29 +00:00
2011-08-10 20:25:29 +00:00
2011-08-10 20:25:29 +00:00
2011-08-10 20:25:29 +00:00
2011-08-10 20:25:29 +00:00
2011-08-10 20:25:29 +00:00