Before, boot devices information for CTs was always empty and we didn't indicate that containers can boot from disk. Signed-off-by: Maxim Nestratov <mnestratov@xxxxxxxxxxxxx> --- src/vz/vz_sdk.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 54a21a3..cc077f5 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -1704,8 +1704,23 @@ prlsdkBootOrderCheck(PRL_HANDLE sdkdom, PRL_DEVICE_TYPE sdkType, int sdkIndex, 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 -prlsdkConvertBootOrder(PRL_HANDLE sdkdom, virDomainDefPtr def) +prlsdkConvertBootOrderVm(PRL_HANDLE sdkdom, virDomainDefPtr def) { int ret = -1; PRL_RESULT pret; @@ -1864,8 +1879,12 @@ prlsdkLoadDomain(vzDriverPtr driver, goto error; /* depends on prlsdkAddDomainHardware */ - if (prlsdkConvertBootOrder(sdkdom, def) < 0) - goto error; + if (IS_CT(def)) { + prlsdkConvertBootOrderCt(def); + } else { + if (prlsdkConvertBootOrderVm(sdkdom, def) < 0) + goto error; + } pret = PrlVmCfg_GetEnvId(sdkdom, &envId); prlsdkCheckRetGoto(pret, error); -- 2.4.11 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list