util: avoid getting stuck on macvtapN name created outside libvirt
util: avoid getting stuck on macvtapN name created outside libvirt

After the patches that added tracking of in-use macvtap names (commit
370608, first appearing in libvirt-1.3.2), if the function to allocate
a new macvtap device came to a device name created outside libvirt, it
would retry the same device name MACVLAN_MAX_ID (8191) times before
finally giving up in failure.

The problem was that virBitmapNextClearBit was always being called
with "0" rather than the value most recently checked (which would
increment each time through the loop), so it would always return the
same id (since we dutifully release that id after failing to create a
new device using it).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1321546

Signed-off-by: Laine Stump <c23361c43fbf79fed83e8b76173707b083d6caf5@laine.org>

fabianfreyer/libvirt,datto/libvirt,jardasgit/libvirt,eskultety/libvirt,fabianfreyer/libvirt,crobinso/libvirt,taget/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,taget/libvirt,zippy2/libvirt,olafhering/libvirt,jfehlig/libvirt,nertpinx/libvirt,jfehlig/libvirt,datto/libvirt,crobinso/libvirt,taget/libvirt,olafhering/libvirt,zippy2/libvirt,andreabolognani/libvirt,nertpinx/libvirt,eskultety/libvirt,libvirt/libvirt,libvirt/libvirt,datto/libvirt,taget/libvirt,eskultety/libvirt,taget/libvirt,nertpinx/libvirt,eskultety/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,libvirt/libvirt,VenkatDatta/libvirt,zippy2/libvirt,VenkatDatta/libvirt,datto/libvirt,andreabolognani/libvirt,VenkatDatta/libvirt,crobinso/libvirt,jardasgit/libvirt,nertpinx/libvirt,olafhering/libvirt,jardasgit/libvirt,libvirt/libvirt,olafhering/libvirt,andreabolognani/libvirt,fabianfreyer/libvirt,VenkatDatta/libvirt,eskultety/libvirt,datto/libvirt,jardasgit/libvirt,jfehlig/libvirt,zippy2/libvirt,VenkatDatta/libvirt,andreabolognani/libvirt,jardasgit/libvirt,crobinso/libvirt