1
0

domain_validate.c: rename virSecurityDeviceLabelDefValidateXML()

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.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Daniel Henrique Barboza 2020-12-08 17:21:38 -03:00
parent 98bc393579
commit b9e56a0fa0
3 changed files with 17 additions and 17 deletions

View File

@ -6164,10 +6164,10 @@ virDomainChrSourceDefValidate(const virDomainChrSourceDef *src_def,
break; break;
} }
if (virSecurityDeviceLabelDefValidateXML(src_def->seclabels, if (virSecurityDeviceLabelDefValidate(src_def->seclabels,
src_def->nseclabels, src_def->nseclabels,
def->seclabels, def->seclabels,
def->nseclabels) < 0) def->nseclabels) < 0)
return -1; return -1;
return 0; return 0;

View File

@ -195,10 +195,10 @@ virDomainDiskAddressDiskBusCompatibility(virDomainDiskBus bus,
int int
virSecurityDeviceLabelDefValidateXML(virSecurityDeviceLabelDefPtr *seclabels, virSecurityDeviceLabelDefValidate(virSecurityDeviceLabelDefPtr *seclabels,
size_t nseclabels, size_t nseclabels,
virSecurityLabelDefPtr *vmSeclabels, virSecurityLabelDefPtr *vmSeclabels,
size_t nvmSeclabels) size_t nvmSeclabels)
{ {
virSecurityDeviceLabelDefPtr seclabel; virSecurityDeviceLabelDefPtr seclabel;
size_t i; size_t i;
@ -213,7 +213,7 @@ virSecurityDeviceLabelDefValidateXML(virSecurityDeviceLabelDefPtr *seclabels,
continue; continue;
if (!vmSeclabels[j]->relabel) { if (!vmSeclabels[j]->relabel) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("label overrides require relabeling to be " _("label overrides require relabeling to be "
"enabled at the domain level")); "enabled at the domain level"));
return -1; return -1;
@ -297,10 +297,10 @@ virDomainDiskDefValidate(const virDomainDef *def,
} }
for (next = disk->src; next; next = next->backingStore) { for (next = disk->src; next; next = next->backingStore) {
if (virSecurityDeviceLabelDefValidateXML(next->seclabels, if (virSecurityDeviceLabelDefValidate(next->seclabels,
next->nseclabels, next->nseclabels,
def->seclabels, def->seclabels,
def->nseclabels) < 0) def->nseclabels) < 0)
return -1; return -1;
} }

View File

@ -28,9 +28,9 @@ int virDomainDefBootValidate(const virDomainDef *def);
int virDomainDefVideoValidate(const virDomainDef *def); int virDomainDefVideoValidate(const virDomainDef *def);
int virDomainVideoDefValidate(const virDomainVideoDef *video, int virDomainVideoDefValidate(const virDomainVideoDef *video,
const virDomainDef *def); const virDomainDef *def);
int virSecurityDeviceLabelDefValidateXML(virSecurityDeviceLabelDefPtr *seclabels, int virSecurityDeviceLabelDefValidate(virSecurityDeviceLabelDefPtr *seclabels,
size_t nseclabels, size_t nseclabels,
virSecurityLabelDefPtr *vmSeclabels, virSecurityLabelDefPtr *vmSeclabels,
size_t nvmSeclabels); size_t nvmSeclabels);
int virDomainDiskDefValidate(const virDomainDef *def, int virDomainDiskDefValidate(const virDomainDef *def,
const virDomainDiskDef *disk); const virDomainDiskDef *disk);