On Mon, Feb 01, 2016 at 03:29:53PM -0500, John Ferlan wrote:
Modify the regex for the 'devices' (a/k/a 'extents')
from "(\\S+)"
(e.g., 1 or more) to "(\\S*)" (e.g., zero or more).
Then for any "thin" lv's found, mark the volume as a sparse volume so
that the volume wipe algorithm doesn't work.
Since a "thin" segtype has no devices, this will result in any
"thin"
lv part of some thin-pool within a volume group used as a libvirt pool
to be displayed as a possible volume to use.
A thin pool is another layer on top of some of the LVs in the VG.
I think it deserves a separate pool type.
NB:
Based on a proposal authored by Joe Harvell <joe.harvell(a)tekcomms.com>,
but with much intervening rework, the resulting patch is changed from
the original concept. About all that remains is changing the regex and
checking for NULL/empty field during parse.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/storage/storage_backend_logical.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
@@ -342,7 +348,7 @@
virStorageBackendLogicalFindLVs(virStoragePoolObjPtr pool,
* striped, so "," is not a suitable separator either (rhbz 727474).
*/
const char *regexes[] = {
-
"^\\s*(\\S+)#(\\S*)#(\\S+)#(\\S+)#(\\S+)#([0-9]+)#(\\S+)#([0-9]+)#([0-9]+)#(\\S+)#?\\s*$"
+
"^\\s*(\\S+)#(\\S*)#(\\S+)#(\\S*)#(\\S+)#([0-9]+)#(\\S+)#([0-9]+)#([0-9]+)#(\\S+)#?\\s*$"
This regex and changes to it would be much more readable split into
multiple lines, like VIR_LOG_REGEX.
Jan