]> git.ipfire.org Git - thirdparty/libvirt.git/commit
hostdev: Fix index error in loop after remove an element
authorHuanle Han <hanxueluo@gmail.com>
Thu, 26 Mar 2015 14:23:46 +0000 (22:23 +0800)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 2 Apr 2015 14:05:32 +0000 (16:05 +0200)
commit7adb4bfc805ee61714df5a2d43688096bdfe17d6
tree2efb4bacf7fdc4176c4f368d4ff20e8cf269be96
parentb84c5729d9d8ba9d8479f8aff2934dffec631a1c
hostdev: Fix index error in loop after remove an element

'virPCIDeviceList' is actually an array. Removing one element makes the
rest of the element move.

Use while loop, increase index only when not virPCIDeviceListDel(pcidevs, dev)

Signed-off-by: Huanle Han <hanxueluo@gmail.com>
src/util/virhostdev.c