]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: avoid getting stuck on macvtapN name created outside libvirt
authorLaine Stump <laine@laine.org>
Mon, 28 Mar 2016 14:14:04 +0000 (10:14 -0400)
committerLaine Stump <laine@laine.org>
Mon, 28 Mar 2016 16:52:50 +0000 (12:52 -0400)
commit5b5f12cffa86a1b4527bde620c2a86c5e96ad7c5
treee8c3a919e709dde25d85d208335e412dd7be4fd0
parent373b9e9f000cad36b3d6b7d623c466bfc0e62754
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 <laine@laine.org>
src/util/virnetdevmacvlan.c