mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-14 23:24:23 +03:00
vz: refactoring of prlsdkCreateCt
We do not need to check domainf fs type there, because it is done in prlsdkCheckUnsupportedParams. Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
This commit is contained in:
parent
e05274a2a4
commit
cec0309840
@ -3872,23 +3872,20 @@ prlsdkCreateCt(vzDriverPtr driver, virDomainDefPtr def)
|
||||
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) {
|
||||
for (i = 0; i < def->nfss; i++) {
|
||||
if (useTemplate) {
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("Unsupported filesystem type."));
|
||||
_("Unsupported configuration"));
|
||||
return -1;
|
||||
}
|
||||
if (def->fss[i]->type == VIR_DOMAIN_FS_TYPE_TEMPLATE)
|
||||
useTemplate = 1;
|
||||
}
|
||||
|
||||
if (useTemplate && def->nfss > 1) {
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("Unsupported configuration"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
confParam.nVmType = PVT_CT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user