[libvirt] bug in libvirt.c?

for (i = 0; i < virNetworkDriverTabCount; i++) { if ((virDriverTab[i]->probe != NULL) && ((latest = virDriverTab[i]->probe()) != NULL)) { probes++; ..... } } We use array virDriverTab, but cicle is to virNetworkDriverTabCount which count number of virNetworkDriverTab drivers. I think virDriverTabCount should be used. Index: libvirt.c =================================================================== RCS file: /data/cvs/libvirt/src/libvirt.c,v retrieving revision 1.147 diff -u -p -r1.147 libvirt.c --- libvirt.c 26 Jun 2008 09:37:51 -0000 1.147 +++ libvirt.c 10 Jul 2008 14:48:44 -0000 @@ -699,7 +699,7 @@ do_open (const char *name, const char *use = NULL; const char *latest; int probes = 0; - for (i = 0; i < virNetworkDriverTabCount; i++) { + for (i = 0; i < virDriverTabCount; i++) { if ((virDriverTab[i]->probe != NULL) && ((latest = virDriverTab[i]->probe()) != NULL)) { probes++;

On Thu, Jul 10, 2008 at 06:49:22PM +0400, Evgeniy Sokolov wrote:
for (i = 0; i < virNetworkDriverTabCount; i++) { if ((virDriverTab[i]->probe != NULL) && ((latest = virDriverTab[i]->probe()) != NULL)) { probes++;
..... } }
We use array virDriverTab, but cicle is to virNetworkDriverTabCount which count number of virNetworkDriverTab drivers. I think virDriverTabCount should be used.
Yes it should. So basically our auto-probe was only checking the first 3 drivers (we have network drivers registered from qemu, test & remote)
Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Thu, Jul 10, 2008 at 06:49:22PM +0400, Evgeniy Sokolov wrote:
for (i = 0; i < virNetworkDriverTabCount; i++) { if ((virDriverTab[i]->probe != NULL) && ((latest = virDriverTab[i]->probe()) != NULL)) { probes++;
..... } }
We use array virDriverTab, but cicle is to virNetworkDriverTabCount which count number of virNetworkDriverTab drivers. I think virDriverTabCount should be used.
Urgh, good catch ! Applied and commited, thanks ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Evgeniy Sokolov