]> xenbits.xensource.com Git - libvirt.git/commit
conf: eliminate repetitive code in virDomainPCIAddressGetNextSlot()
authorLaine Stump <laine@laine.org>
Wed, 19 Oct 2016 17:58:42 +0000 (13:58 -0400)
committerLaine Stump <laine@laine.org>
Wed, 11 Jan 2017 09:38:04 +0000 (04:38 -0500)
commit99bf66f3fa38884294a51f68bf24ea93eaf0dbb5
tree74342981240a8539c68c951524ab24bb73f15539
parent9ff9d9f5a905dee7aabbeeae932efda0df1960f1
conf: eliminate repetitive code in virDomainPCIAddressGetNextSlot()

virDomainPCIAddressGetNextSlot() starts searching from the last
allocated address and goes to the end of all the buses, then goes back
to the first bus and searches from there up to the starting point (in
case any address has been freed since the last time an address was
allocated. The loops for these two are almost, but not exactly, the
same, so they have remained as separate loops with the same code
inside the loop. To lessen maintenance headaches, the identical code
has been moved out into the function
virDomainPCIAddressFindUnusedFunctionOnBus(), which is called in place
of the loop contents.
src/conf/domain_addr.c