Re: [libvirt] [PATCH 1/2] hostdev: Fix index error in loop after remove an element

2015-04-02 Thread Martin Kletzander
On Tue, Mar 31, 2015 at 10:34:57AM +0200, Martin Kletzander wrote: On Thu, Mar 26, 2015 at 10:23:46PM +0800, Huanle Han wrote: 'virPCIDeviceList' is actually an array. Removing one element makes the rest of the element move. Use while loop, increase index only when not

Re: [libvirt] [PATCH 1/2] hostdev: Fix index error in loop after remove an element

2015-03-31 Thread Martin Kletzander
On Thu, Mar 26, 2015 at 10:23:46PM +0800, Huanle Han wrote: '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 hanxue...@gmail.com ---

[libvirt] [PATCH 1/2] hostdev: Fix index error in loop after remove an element

2015-03-26 Thread Huanle Han
'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 hanxue...@gmail.com --- src/util/virhostdev.c | 4 +++- 1 file changed, 3 insertions(+), 1