[libvirt] [PATCH 4/4] logical: Adjust regex for devices

Pavel Hrdina phrdina at redhat.com
Tue Jan 26 14:55:02 UTC 2016


On Fri, Jan 22, 2016 at 05:21:06PM -0500, John Ferlan wrote:
> From: Joe Harvell <joe.harvell at tekcomms.com>
> 
> Since our 'devices' parsing logic now will use the 'nextents' (or
> lvs 'stripes' output) to decide whether or not to parse the field,
> use the regex of "(\\S*)" (e.g. zero or more) instead of "(\\S+)"
> (1 or more) when grabbing the 'groups[3]' or 'devices' field.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/storage/storage_backend_logical.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
> index 3010f58..2af3e69 100644
> --- a/src/storage/storage_backend_logical.c
> +++ b/src/storage/storage_backend_logical.c
> @@ -333,7 +333,8 @@ virStorageBackendLogicalFindLVs(virStoragePoolObjPtr pool,
>       *    striped, so "," is not a suitable separator either (rhbz 727474).
>       */
>      const char *regexes[] = {
> -       "^\\s*(\\S+)#(\\S*)#(\\S+)#(\\S+)#([0-9]+)#(\\S+)#([0-9]+)#([0-9]+)#(\\S+)#?\\s*$"
> +/*             name   orig   uuid   devs  stripes  segsz  vgextsz       sz lvattr */
> +       "^\\s*(\\S+)#(\\S*)#(\\S+)#(\\S*)#([0-9]+)#(\\S+)#([0-9]+)#([0-9]+)#(\\S+)#?\\s*$"
>      };
>      int vars[] = {
>          9

This could be squashed into the previous commit and if you are creating a
comment with labels, please use the exact names that lvs uses.




More information about the libvir-list mailing list