vz: make error handling idiomatic in prlsdkCreateVm

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
This commit is contained in:
Nikolay Shirokovskiy 2016-06-14 11:45:55 +03:00 committed by Maxim Nestratov
parent e43fb4ee77
commit c2f5dc24c5

View File

@ -3900,13 +3900,14 @@ prlsdkCreateVm(vzDriverPtr driver, virDomainDefPtr def)
pret = PrlVmCfg_SetOfflineManagementEnabled(sdkdom, 0);
prlsdkCheckRetGoto(pret, cleanup);
ret = prlsdkDoApplyConfig(driver, sdkdom, def, NULL);
if (ret)
if (prlsdkDoApplyConfig(driver, sdkdom, def, NULL) < 0)
goto cleanup;
job = PrlVm_Reg(sdkdom, "", 1);
if (PRL_FAILED(waitJob(job)))
ret = -1;
goto cleanup;
ret = 0;
cleanup:
PrlHandle_Free(sdkdom);