[libvirt] [PATCH 2/2] storage: Disallow vol_wipe for sparse logical volumes

Eric Blake eblake at redhat.com
Thu Jul 17 19:07:14 UTC 2014


On 07/17/2014 12:10 PM, John Ferlan wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1091866
> 
> Add a new boolean 'sparse'.  This will be used by the logical backend
> storage driver to determine whether the target volume is sparse or not
> (also known by a snapshot or thin logical volume). Although setting sparse
> to true at creation could be seen as duplicitous to setting during
> virStorageBackendLogicalMakeVol() in case there are ever other code paths
> between Create and FindLVs that need to know about the volume be sparse.
> 
> Use the 'sparse' in a new virStorageBackendLogicalVolWipe() to decide whether
> to attempt to wipe the logical volume or not. For now, I have found no
> means to wipe the volume without writing to it. Writing to the sparse
> volume causes it to be filled. A sparse logical volume is not complely

s/complely/completely/

> writeable as there exists metadata which if overwritten will cause the
> sparse lv to go INACTIVE which means pool-refresh will not find it.
> Access to whatever lvm uses to manage data blocks is not provided by
> any API I could find.
> 

I wonder if lvm developers could point us to an alternative; maybe even
lvreduce (shrink the allocated size) followed by lvresize (regrow it,
but the new growth starts life empty) might behave semantically like a
wipe.  But yeah, we don't need to solve that today.

> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/storage/storage_backend_logical.c | 39 ++++++++++++++++++++++++++++++++++-
>  src/util/virstoragefile.h             |  1 +
>  2 files changed, 39 insertions(+), 1 deletion(-)
> 

ACK

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140717/f3302e37/attachment-0001.sig>


More information about the libvir-list mailing list