mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
conf: Move checks from virDomainDiskDefPostParse to virDomainDiskDefValidate
The moved code contains only checks and does not modify the parsed document so it doesn't belong into the PostParse code. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
fc2e60fda7
commit
1645fc6aa7
@ -5367,25 +5367,6 @@ virDomainDiskDefPostParse(virDomainDiskDef *disk,
|
|||||||
const virDomainDef *def,
|
const virDomainDef *def,
|
||||||
virDomainXMLOption *xmlopt)
|
virDomainXMLOption *xmlopt)
|
||||||
{
|
{
|
||||||
/* internal snapshots and config files are currently supported
|
|
||||||
* only with rbd: */
|
|
||||||
if (virStorageSourceGetActualType(disk->src) != VIR_STORAGE_TYPE_NETWORK &&
|
|
||||||
disk->src->protocol != VIR_STORAGE_NET_PROTOCOL_RBD) {
|
|
||||||
if (disk->src->snapshot) {
|
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
|
||||||
_("<snapshot> element is currently supported "
|
|
||||||
"only with 'rbd' disks"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (disk->src->configFile) {
|
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
|
||||||
_("<config> element is currently supported "
|
|
||||||
"only with 'rbd' disks"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (disk->src->type == VIR_STORAGE_TYPE_NETWORK &&
|
if (disk->src->type == VIR_STORAGE_TYPE_NETWORK &&
|
||||||
disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI) {
|
disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI) {
|
||||||
virDomainPostParseCheckISCSIPath(&disk->src->path);
|
virDomainPostParseCheckISCSIPath(&disk->src->path);
|
||||||
|
@ -469,6 +469,24 @@ virDomainDiskDefValidateSourceChainOne(const virStorageSource *src)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* internal snapshots and config files are currently supported only with rbd: */
|
||||||
|
if (virStorageSourceGetActualType(src) != VIR_STORAGE_TYPE_NETWORK &&
|
||||||
|
src->protocol != VIR_STORAGE_NET_PROTOCOL_RBD) {
|
||||||
|
if (src->snapshot) {
|
||||||
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
|
_("<snapshot> element is currently supported "
|
||||||
|
"only with 'rbd' disks"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (src->configFile) {
|
||||||
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
|
_("<config> element is currently supported "
|
||||||
|
"only with 'rbd' disks"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user