Bug 748194 - libvirt should ignore virtual backing store for sparse volume
Summary: libvirt should ignore virtual backing store for sparse volume
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-22 22:35 UTC by Ryan Smith-Roberts
Modified: 2016-04-26 15:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-28 15:37:10 UTC


Attachments (Terms of Use)
Patch to ignore virtual backing stores of LVM sparse volumes (713 bytes, patch)
2011-10-22 22:35 UTC, Ryan Smith-Roberts
no flags Details | Diff

Description Ryan Smith-Roberts 2011-10-22 22:35:05 UTC
Created attachment 529645 [details]
Patch to ignore virtual backing stores of LVM sparse volumes

Description of problem:
When one creates a sparse volume in LVM, its backing store is a "virtual" volume which is not normally displayed and has no /dev entry of the form "/dev/$pool/$volume".  libvirt fails to recognize the backing store as virtual and fails the pool after attempting to open this nonexistent device path.

Version-Release number of selected component (if applicable):
git head, 0.9.6, 0.9.2 at least (tested on Ubuntu, FWIW)

How reproducible:
100%

Steps to Reproduce:
1. create an LVM pool in libvirt 
2. manually add a volume using the lvcreate "--virtualsize" option
3. refresh the pool
  
Actual results:
error : virStorageBackendVolOpenCheckMode:1020 : cannot open volume '/dev/xxx/[yyy_vorigin]': No such file or directory

Expected results:
Addition of the sparse LVM volume to the pool's volume list, ignoring the existence of the virtual volume.

Additional info:
Patch attached

Comment 1 Dave Allan 2011-10-25 20:10:16 UTC
Hi Ryan,  If you haven't already, would you mind submitting your patch to the upstream list (libvir-list) for discussion?  Thanks, Dave

Comment 2 Ján Tomko 2015-07-28 15:37:10 UTC
Fixed upstream by:
commit d26b73ca2b1c35957b3c709a6cd9b3fd6a3d332a
Author:     Osier Yang <jyang>
AuthorDate: 2011-11-18 19:15:10 +0800
Commit:     Osier Yang <jyang>
CommitDate: 2011-11-21 11:26:54 +0800

    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 "[".

git describe: v0.9.7-109-gd26b73c contains: v0.9.8-rc1~123


Note You need to log in before you can comment on or make changes to this bug.