3 # Copyright (C) 2013 Red Hat, Inc.
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library. If not, see
17 # <http://www.gnu.org/licenses/>.
28 foreach my $symfile (@symfiles) {
29 open SYMFILE
, "<", $symfile
30 or die "cannot read $symfile: $!";
32 if (/^\s*(vir\w+)\s*;\s*$/) {
40 open DRVFILE
, "<", $drvfile
41 or die "cannot read $drvfile: $!";
46 next if /virDrvConnectSupportsFeature/;
47 if (/\*(virDrv\w+)\s*\)/) {
51 next if $drv =~ /virDrvState/;
52 next if $drv =~ /virDrvDomainMigrate(Prepare|Perform|Confirm|Begin|Finish)/;
55 $sym =~ s/virDrv/vir/;
57 unless (exists $symbols{$sym}) {
58 print "Driver method name $drv doesn't match public API name\n";
61 } elsif (/^\*(vir\w+)\s*\)/) {
63 print "Bogus name $1\n";
65 } elsif (/^\s*(virDrv\w+)\s+(\w+);\s*/) {
71 $tmp =~ s/^NWFilter/nwfilter/;
72 $tmp =~ s/^(\w)/lc $1/e;
74 unless ($tmp eq $field) {
75 print "Driver struct field $field should be named $tmp\n";