]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix rpc generator to anchor matches for method names
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 19 Jan 2012 14:19:42 +0000 (14:19 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 19 Jan 2012 15:39:54 +0000 (15:39 +0000)
The RPC generator transforms methods matching certain
patterns like 'id' or 'uuid', etc but does not anchor
its matches to the end of the word. So if a method
contains 'id' in the middle (eg virIdentity) then the
RPC generator munges that.

* src/rpc/gendispatch.pl: Anchor matches

src/rpc/gendispatch.pl

index b36ca692922985d7e1990fce56bddce8052d586e..0460fca32ec70d4fd4ac2de49faebbba1c4c7f80 100755 (executable)
@@ -34,10 +34,10 @@ sub name_to_ProcName {
     my $name = shift;
     my @elems = split /_/, $name;
     @elems = map ucfirst, @elems;
-    @elems = map { $_ =~ s/Nwfilter/NWFilter/; $_ =~ s/Xml/XML/;
-                   $_ =~ s/Uri/URI/; $_ =~ s/Uuid/UUID/; $_ =~ s/Id/ID/;
-                   $_ =~ s/Mac/MAC/; $_ =~ s/Cpu/CPU/; $_ =~ s/Os/OS/;
-                   $_ =~ s/Nmi/NMI/; $_ } @elems;
+    @elems = map { $_ =~ s/Nwfilter/NWFilter/; $_ =~ s/Xml$/XML/;
+                   $_ =~ s/Uri$/URI/; $_ =~ s/Uuid$/UUID/; $_ =~ s/Id$/ID/;
+                   $_ =~ s/Mac$/MAC/; $_ =~ s/Cpu$/CPU/; $_ =~ s/Os$/OS/;
+                   $_ =~ s/Nmi$/NMI/; $_ } @elems;
     join "", @elems
 }