[libvirt PATCH 04/11] scripts: group-qemu-caps: remove unnecessary regexes

Ján Tomko jtomko at redhat.com
Tue Aug 24 14:25:07 UTC 2021


regroup_caps uses these to filter out lines that should not
increase the counter. Here, we only care about the capability
constants, so we can let the final matching regex take care
of the matching.

Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 scripts/group-qemu-caps.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/scripts/group-qemu-caps.py b/scripts/group-qemu-caps.py
index e56c306d10..ee33f1cf16 100755
--- a/scripts/group-qemu-caps.py
+++ b/scripts/group-qemu-caps.py
@@ -44,11 +44,7 @@ def load_caps_flags(filename, start_regex, end_regex):
             break
 
     for line in lines[start:end]:
-        if re.search(r'''.*/\* [0-9]+ \*/.*''', line):
-            continue
-        if re.search(r'''^\s*$''', line):
-            continue
-        match = re.search(r'''[ ]+([A-Z0-9_]+)''', line)
+        match = re.search(r'''[ ]+([A-Z0-9_]+),''', line)
 
         if match:
             capsflags.append(match[1])
-- 
2.31.1




More information about the libvir-list mailing list