[libvirt] [PATCH 1/2] check scripts: handle unintialized driver vars in check-driverimpls.pl

Nikolay Shirokovskiy nshirokovskiy at virtuozzo.com
Wed Apr 18 14:31:12 UTC 2018


Current script does not recognize uninitialized driver vars and
interprets next lines as if there is initialization section.

Let's assume we have sane initialization syntax for drivers
if it's present and check we if we have open braces.
---
 src/check-driverimpls.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/check-driverimpls.pl b/src/check-driverimpls.pl
index 4c28f20..63da2e1 100755
--- a/src/check-driverimpls.pl
+++ b/src/check-driverimpls.pl
@@ -67,7 +67,7 @@ while (<>) {
                 $status = 1;
             }
         }
-    } elsif (/^(?:static\s+)?(vir(?:\w+)?Driver)\s+/) {
+    } elsif (/^(?:static\s+)?(vir(?:\w+)?Driver)\s+(?:\w+)\s*=\s*{\s*$/) {
         next if $1 eq "virNWFilterCallbackDriver" ||
                 $1 eq "virNWFilterTechDriver" ||
                 $1 eq "virConnectDriver";
-- 
1.8.3.1




More information about the libvir-list mailing list