The function isn't doing XML validation of any sort. Rename it to
be compatible with its actual use.
While we're at it, change the VIR_ERR_XML_ERROR error being thrown
in the function to VIR_ERR_CONFIG_UNSUPPORTED.
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
src/conf/domain_conf.c | 8 ++++----
src/conf/domain_validate.c | 18 +++++++++---------
src/conf/domain_validate.h | 8 ++++----
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 220bb8cdcf..6578055119 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6164,10 +6164,10 @@ virDomainChrSourceDefValidate(const virDomainChrSourceDef
*src_def,
break;
}
- if (virSecurityDeviceLabelDefValidateXML(src_def->seclabels,
- src_def->nseclabels,
- def->seclabels,
- def->nseclabels) < 0)
+ if (virSecurityDeviceLabelDefValidate(src_def->seclabels,
+ src_def->nseclabels,
+ def->seclabels,
+ def->nseclabels) < 0)
return -1;
return 0;
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index bc5ca3f668..e9427cffa8 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -195,10 +195,10 @@ virDomainDiskAddressDiskBusCompatibility(virDomainDiskBus bus,
int
-virSecurityDeviceLabelDefValidateXML(virSecurityDeviceLabelDefPtr *seclabels,
- size_t nseclabels,
- virSecurityLabelDefPtr *vmSeclabels,
- size_t nvmSeclabels)
+virSecurityDeviceLabelDefValidate(virSecurityDeviceLabelDefPtr *seclabels,
+ size_t nseclabels,
+ virSecurityLabelDefPtr *vmSeclabels,
+ size_t nvmSeclabels)
{
virSecurityDeviceLabelDefPtr seclabel;
size_t i;
@@ -213,7 +213,7 @@ virSecurityDeviceLabelDefValidateXML(virSecurityDeviceLabelDefPtr
*seclabels,
continue;
if (!vmSeclabels[j]->relabel) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("label overrides require relabeling to be "
"enabled at the domain level"));
return -1;
@@ -297,10 +297,10 @@ virDomainDiskDefValidate(const virDomainDef *def,
}
for (next = disk->src; next; next = next->backingStore) {
- if (virSecurityDeviceLabelDefValidateXML(next->seclabels,
- next->nseclabels,
- def->seclabels,
- def->nseclabels) < 0)
+ if (virSecurityDeviceLabelDefValidate(next->seclabels,
+ next->nseclabels,
+ def->seclabels,
+ def->nseclabels) < 0)
return -1;
}
diff --git a/src/conf/domain_validate.h b/src/conf/domain_validate.h
index fe7c752e8c..aef169a4c9 100644
--- a/src/conf/domain_validate.h
+++ b/src/conf/domain_validate.h
@@ -28,9 +28,9 @@ int virDomainDefBootValidate(const virDomainDef *def);
int virDomainDefVideoValidate(const virDomainDef *def);
int virDomainVideoDefValidate(const virDomainVideoDef *video,
const virDomainDef *def);
-int virSecurityDeviceLabelDefValidateXML(virSecurityDeviceLabelDefPtr *seclabels,
- size_t nseclabels,
- virSecurityLabelDefPtr *vmSeclabels,
- size_t nvmSeclabels);
+int virSecurityDeviceLabelDefValidate(virSecurityDeviceLabelDefPtr *seclabels,
+ size_t nseclabels,
+ virSecurityLabelDefPtr *vmSeclabels,
+ size_t nvmSeclabels);
int virDomainDiskDefValidate(const virDomainDef *def,
const virDomainDiskDef *disk);
--
2.26.2