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 <hanxueluo@gmail.com>
This commit is contained in:
parent
c61ded8a7d
commit
a959671da8
@ -693,7 +693,7 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr,
|
|||||||
|
|
||||||
resetvfnetconfig:
|
resetvfnetconfig:
|
||||||
for (i = 0;
|
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);
|
virHostdevNetConfigRestore(hostdevs[i], hostdev_mgr->stateDir, NULL);
|
||||||
|
|
||||||
reattachdevs:
|
reattachdevs:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user