]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
hostdev: fix loop index error when resetvfnetconfig
authorHuanle Han <hanxueluo@gmail.com>
Thu, 2 Apr 2015 15:56:19 +0000 (23:56 +0800)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 14 Apr 2015 12:49:15 +0000 (14:49 +0200)
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 <hanxueluo@gmail.com>
src/util/virhostdev.c

index 68e060b9852cbd5e8422e0a31bf76a949db8de89..f583e545c04c4c54b5b9559fa4e89c1ae70cc75b 100644 (file)
@@ -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: