mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 18:03:50 +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;
|
int useTemplate = 0;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (def->nfss > 1) {
|
|
||||||
/* Check all filesystems */
|
|
||||||
for (i = 0; i < def->nfss; i++) {
|
for (i = 0; i < def->nfss; i++) {
|
||||||
if (def->fss[i]->type != VIR_DOMAIN_FS_TYPE_FILE) {
|
if (useTemplate) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("Unsupported filesystem type."));
|
_("Unsupported configuration"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
if (def->fss[i]->type == VIR_DOMAIN_FS_TYPE_TEMPLATE)
|
||||||
} else if (def->nfss == 1) {
|
|
||||||
if (def->fss[0]->type == VIR_DOMAIN_FS_TYPE_TEMPLATE) {
|
|
||||||
useTemplate = 1;
|
useTemplate = 1;
|
||||||
} else if (def->fss[0]->type != VIR_DOMAIN_FS_TYPE_FILE) {
|
|
||||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
|
||||||
_("Unsupported filesystem type."));
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (useTemplate && def->nfss > 1) {
|
||||||
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
|
_("Unsupported configuration"));
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
confParam.nVmType = PVT_CT;
|
confParam.nVmType = PVT_CT;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user