vz: fix disk enumeration

If we want to delete all disks for container or vm
we should make a loop from 0 to NumberOfDisks and always
use zero index in PrlVmCfg_GetHardDisk to get disk handle.
When we delete first disk after that numbers of other disks
will be changed, start from 0 to NumberOfDisks-1.
That's why we should always use zero index.
This commit is contained in:
Mikhail Feoktistov 2016-04-27 11:37:27 -04:00 committed by Jiri Denemark
parent 4d28d0931f
commit cdbbb93a96

View File

@ -3810,7 +3810,7 @@ prlsdkDetachDomainHardDisks(PRL_HANDLE sdkdom)
prlsdkCheckRetGoto(pret, cleanup);
for (i = 0; i < hddCount; ++i) {
pret = PrlVmCfg_GetHardDisk(sdkdom, i, &sdkdisk);
pret = PrlVmCfg_GetHardDisk(sdkdom, 0, &sdkdisk);
prlsdkCheckRetGoto(pret, cleanup);
pret = PrlVmDev_Remove(sdkdisk);