From: Huanle Han Date: Thu, 2 Apr 2015 15:56:19 +0000 (+0800) Subject: hostdev: fix loop index error when resetvfnetconfig X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a959671da8ec5b9df036eb15b51021e06c6e058f;p=libvirt.git hostdev: fix loop index error when resetvfnetconfig The variable 'last_processed_hostdev_vf' indicates index of the last successfully configed vf. When resetvfnetconfig because of failure, hostdevs[last_processed_hostdev_vf] should also be reset. Signed-off-by: Huanle Han --- diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 68e060b985..f583e545c0 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -693,7 +693,7 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr, resetvfnetconfig: for (i = 0; - last_processed_hostdev_vf != -1 && i < last_processed_hostdev_vf; i++) + last_processed_hostdev_vf != -1 && i <= last_processed_hostdev_vf; i++) virHostdevNetConfigRestore(hostdevs[i], hostdev_mgr->stateDir, NULL); reattachdevs: