20-Dec-16 13:50, Nikolay Shirokovskiy пишет:
On 09.12.2016 17:36, Maxim Nestratov wrote:
> Before, boot devices information for CTs was always empty and we
> didn't indicate that containers always boot from disk.
>
> Signed-off-by: Maxim Nestratov <mnestratov(a)virtuozzo.com>
> ---
> src/vz/vz_sdk.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
> index 9976e4c..a6236d0 100644
> --- a/src/vz/vz_sdk.c
> +++ b/src/vz/vz_sdk.c
> @@ -1634,7 +1634,7 @@ prlsdkBootOrderCheck(PRL_HANDLE sdkdom, PRL_DEVICE_TYPE
sdkType, int sdkIndex,
> }
>
> static int
> -prlsdkConvertBootOrder(PRL_HANDLE sdkdom, virDomainDefPtr def)
> +prlsdkConvertBootOrderVm(PRL_HANDLE sdkdom, virDomainDefPtr def)
> {
> int ret = -1;
> PRL_RESULT pret;
> @@ -1792,9 +1792,14 @@ prlsdkLoadDomain(vzDriverPtr driver,
> if (prlsdkAddDomainHardware(driver, sdkdom, def) < 0)
> goto error;
>
> - /* depends on prlsdkAddDomainHardware */
> - if (prlsdkConvertBootOrder(sdkdom, def) < 0)
> - goto error;
> + if (IS_CT(def)) {
> + def->os.nBootDevs = 1;
> + def->os.bootDevs[0] = VIR_DOMAIN_BOOT_DISK;
> + } else {
> + /* depends on prlsdkAddDomainHardware */
> + if (prlsdkConvertBootOrderVm(sdkdom, def) < 0)
> + goto error;
> + }
>
> pret = PrlVmCfg_GetEnvId(sdkdom, &envId);
> prlsdkCheckRetGoto(pret, error);
>
I think we'd better make this code symmetrical to prlsdkSetBootOrderCt,
that is report boot order only if there is no filesystem mounted to root.
Also we need to fix prlsdkCheckUnsupportedParams to allow boot order
if there is no root filesystems but still forbid boot from network etc.
Nikolay
Ok. Makes sense to move this change after #4 and rely on def->fss previously
constructed