mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
parallels: move up updating parameter in prlsdkLoadDomain
It is better to get all necessary parameters and check them on newly created configuration before actually creating a domain with them or applying them to an existing domain. Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
This commit is contained in:
parent
739ea3ce78
commit
dc58e7424a
@ -1312,6 +1312,12 @@ prlsdkLoadDomain(parallelsConnPtr privconn,
|
||||
*s = '\0';
|
||||
}
|
||||
|
||||
pret = PrlVmCfg_GetAutoStart(sdkdom, &autostart);
|
||||
prlsdkCheckRetGoto(pret, error);
|
||||
|
||||
if (prlsdkGetDomainState(sdkdom, &domainState) < 0)
|
||||
goto error;
|
||||
|
||||
if (virDomainDefAddImplicitControllers(def) < 0)
|
||||
goto error;
|
||||
|
||||
@ -1349,15 +1355,6 @@ prlsdkLoadDomain(parallelsConnPtr privconn,
|
||||
dom->privateDataFreeFunc = prlsdkDomObjFreePrivate;
|
||||
dom->persistent = 1;
|
||||
|
||||
if (prlsdkGetDomainState(sdkdom, &domainState) < 0)
|
||||
goto error;
|
||||
|
||||
if (prlsdkConvertDomainState(domainState, envId, dom) < 0)
|
||||
goto error;
|
||||
|
||||
pret = PrlVmCfg_GetAutoStart(sdkdom, &autostart);
|
||||
prlsdkCheckRetGoto(pret, error);
|
||||
|
||||
switch (autostart) {
|
||||
case PAO_VM_START_ON_LOAD:
|
||||
dom->autostart = 1;
|
||||
@ -1371,6 +1368,9 @@ prlsdkLoadDomain(parallelsConnPtr privconn,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (prlsdkConvertDomainState(domainState, envId, dom) < 0)
|
||||
goto error;
|
||||
|
||||
if (!pdom->sdkdom) {
|
||||
pret = PrlHandle_AddRef(sdkdom);
|
||||
prlsdkCheckRetGoto(pret, error);
|
||||
|
Loading…
x
Reference in New Issue
Block a user