Re: [PATCH 3/4] vz: refactoring of prlsdkCreateCt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 06.07.2016 17:02, Olga Krishtal wrote:
> We do not need to check domainf fs type there,
> because it is done in prlsdkCheckUnsupportedParams.
> 
> Signed-off-by: Olga Krishtal <okrishtal@xxxxxxxxxxxxx>
> ---
>  src/vz/vz_sdk.c | 21 ++-------------------
>  1 file changed, 2 insertions(+), 19 deletions(-)
> 
> diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
> index b13b84d..dd7eb6e 100644
> --- a/src/vz/vz_sdk.c
> +++ b/src/vz/vz_sdk.c
> @@ -3859,26 +3859,9 @@ prlsdkCreateCt(vzDriverPtr driver, virDomainDefPtr def)
>      PRL_UINT32 flags;
>      int ret = -1;
>      int useTemplate = 0;
> -    size_t i;
>  
> -    if (def->nfss > 1) {
> -        /* Check all filesystems */
> -        for (i = 0; i < def->nfss; i++) {
> -            if (def->fss[i]->type != VIR_DOMAIN_FS_TYPE_FILE) {
> -                virReportError(VIR_ERR_INVALID_ARG, "%s",
> -                               _("Unsupported filesystem type."));
> -                return -1;
> -            }
> -        }
> -    } else if (def->nfss == 1) {
> -        if (def->fss[0]->type == VIR_DOMAIN_FS_TYPE_TEMPLATE) {
> -            useTemplate = 1;
> -        } else if (def->fss[0]->type != VIR_DOMAIN_FS_TYPE_FILE) {
> -            virReportError(VIR_ERR_INVALID_ARG, "%s",
> -                           _("Unsupported filesystem type."));
> -            return -1;

only this branch can be dropped

> -        }
> -    }
> +    if (def->nfss == 1 && def->fss[0]->type == VIR_DOMAIN_FS_TYPE_TEMPLATE)
> +        useTemplate = 1;
>  
>      confParam.nVmType = PVT_CT;
>      confParam.sConfigSample = "vswap.1024MB";
> 

Eventually we can not drop this checks this way as checks in prlsdkAddFS (via prlsdkCheckFSUnsupportedParams)
check only individual filesystems and we need to be sure that if we have template filesystem than 
total number of filesystems is one. Sorry if I misguided you earlier.

Nikolay

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]