]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
storage: Disallow vol_wipe for sparse logical volumes
authorJohn Ferlan <jferlan@redhat.com>
Thu, 17 Jul 2014 16:41:43 +0000 (12:41 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 17 Jul 2014 20:28:59 +0000 (16:28 -0400)
commit8a9f7cbecd91932eff669830fd26e775a240afd6
tree6251d37cacedcebc46de94956f0d5a3074806ce8
parent10087386b94f19cdf1244c99968d0a8354ea2813
storage: Disallow vol_wipe for sparse logical volumes

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 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.
src/storage/storage_backend_logical.c
src/util/virstoragefile.h