]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Skips backingStore of virtual snapshot lv
authorOsier Yang <jyang@redhat.com>
Fri, 18 Nov 2011 11:15:10 +0000 (19:15 +0800)
committerOsier Yang <jyang@redhat.com>
Mon, 21 Nov 2011 03:26:54 +0000 (11:26 +0800)
commitd26b73ca2b1c35957b3c709a6cd9b3fd6a3d332a
treecb7a3b42c92b4cfc9fec9e0159079297de5daf47
parent83ac18937e0cd651378a547b6ba2dafd0760eceb
storage: Skips backingStore of virtual snapshot lv

lvs outputs "[$lvname_vorigin]" for the virtual snapshot lv
(created with "--virtualsize"), and the original device pointed
by "$lvname_vorigin" is just for lvm internal use, one should
never use it.

Per lvm's nameing rules, "[" is not valid as part of the vg/lv name.
(man 8 lvm).

<quote>
VALID NAMES
The following characters are valid for VG and LV names: a-z A-Z 0-9 + _
. -

VG and LV names cannot begin with a hyphen.   There  are  also  various
reserved  names that are used internally by lvm that can not be used as
LV or VG names.  A VG cannot be called anything that exists in /dev/ at
the time of creation, nor can it be called '.' or '..'.  A LV cannot be
called '.' '..' 'snapshot' or 'pvmove'. The LV name may also  not  con‐
tain the strings '_mlog' or '_mimage'
</quote>

So we can skip the set the lv's backingStore by checking if the name
begins with a "[".
src/storage/storage_backend_logical.c