提交 7eda8369 编写于 作者: M Maxim Nestratov

vz: set boot from disk for CT only when there is no root filesystem

Before, boot devices information for CTs was always empty and we
didn't indicate that containers can boot from disk.
Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
上级 8c9252aa
...@@ -1695,8 +1695,23 @@ prlsdkBootOrderCheck(PRL_HANDLE sdkdom, PRL_DEVICE_TYPE sdkType, int sdkIndex, ...@@ -1695,8 +1695,23 @@ prlsdkBootOrderCheck(PRL_HANDLE sdkdom, PRL_DEVICE_TYPE sdkType, int sdkIndex,
return ret; return ret;
} }
static void
prlsdkConvertBootOrderCt(virDomainDefPtr def)
{
size_t i;
for (i = 0; i < def->nfss; i++) {
if (STREQ(def->fss[i]->dst, "/")) {
def->os.nBootDevs = 0;
return;
}
}
def->os.nBootDevs = 1;
def->os.bootDevs[0] = VIR_DOMAIN_BOOT_DISK;
}
static int static int
prlsdkConvertBootOrder(PRL_HANDLE sdkdom, virDomainDefPtr def) prlsdkConvertBootOrderVm(PRL_HANDLE sdkdom, virDomainDefPtr def)
{ {
int ret = -1; int ret = -1;
PRL_RESULT pret; PRL_RESULT pret;
...@@ -1855,8 +1870,12 @@ prlsdkLoadDomain(vzDriverPtr driver, ...@@ -1855,8 +1870,12 @@ prlsdkLoadDomain(vzDriverPtr driver,
goto error; goto error;
/* depends on prlsdkAddDomainHardware */ /* depends on prlsdkAddDomainHardware */
if (prlsdkConvertBootOrder(sdkdom, def) < 0) if (IS_CT(def)) {
prlsdkConvertBootOrderCt(def);
} else {
if (prlsdkConvertBootOrderVm(sdkdom, def) < 0)
goto error; goto error;
}
pret = PrlVmCfg_GetEnvId(sdkdom, &envId); pret = PrlVmCfg_GetEnvId(sdkdom, &envId);
prlsdkCheckRetGoto(pret, error); prlsdkCheckRetGoto(pret, error);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册