[libvirt] [PATCH v3 4/4] logical: Display thin lv's found in a libvirt managed volume group
Ján Tomko
jtomko at redhat.com
Tue Feb 2 08:11:51 UTC 2016
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 at 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 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160202/b06f7f2e/attachment-0001.sig>
More information about the libvir-list
mailing list