maint: simplify driver registration at startup
maint: simplify driver registration at startup

We had a lot of repetition of errors that would occur if we
ever register too many drivers; this is unlikely to occur
unless we start adding a lot of new hypervisor modules, but
if it does occur, it's better to have uniform handling of the
situation, so that a one-line change is all that would be
needed if we decide that an internal error is not the best.

* src/libvirt.c (virDriverCheckTabMaxReturn): New define.
(virRegister*Driver): Use it for less code duplication.

Signed-off-by: Eric Blake <a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com>

jfehlig/libvirt,rlaager/libvirt,libvirt/libvirt,shugaoye/libvirt,elmarco/libvirt,fabianfreyer/libvirt,olafhering/libvirt,olafhering/libvirt,jardasgit/libvirt,datto/libvirt,libvirt/libvirt,agx/libvirt,elmarco/libvirt,nertpinx/libvirt,nertpinx/libvirt,shugaoye/libvirt,elmarco/libvirt,shugaoye/libvirt,zippy2/libvirt,VenkatDatta/libvirt,andreabolognani/libvirt,rlaager/libvirt,jfehlig/libvirt,eskultety/libvirt,olafhering/libvirt,andreabolognani/libvirt,zippy2/libvirt,rlaager/libvirt,agx/libvirt,agx/libvirt,nertpinx/libvirt,zippy2/libvirt,fabianfreyer/libvirt,datto/libvirt,libvirt/libvirt,fabianfreyer/libvirt,eskultety/libvirt,VenkatDatta/libvirt,crobinso/libvirt,shugaoye/libvirt,jardasgit/libvirt,jardasgit/libvirt,elmarco/libvirt,jfehlig/libvirt,agx/libvirt,libvirt/libvirt,andreabolognani/libvirt,datto/libvirt,datto/libvirt,eskultety/libvirt,andreabolognani/libvirt,andreabolognani/libvirt,nertpinx/libvirt,VenkatDatta/libvirt,datto/libvirt,taget/libvirt,jfehlig/libvirt,shugaoye/libvirt,eskultety/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,olafhering/libvirt,crobinso/libvirt,jardasgit/libvirt,taget/libvirt,crobinso/libvirt,rlaager/libvirt,taget/libvirt,taget/libvirt,VenkatDatta/libvirt,agx/libvirt,rlaager/libvirt,fabianfreyer/libvirt,crobinso/libvirt,eskultety/libvirt,jardasgit/libvirt,zippy2/libvirt,VenkatDatta/libvirt,taget/libvirt,elmarco/libvirt