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

John Ferlan jferlan at redhat.com
Fri Jan 22 22:21:06 UTC 2016


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
-- 
2.5.0




More information about the libvir-list mailing list