]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domain_validate.c: rename virSecurityDeviceLabelDefValidateXML()
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Tue, 8 Dec 2020 20:21:38 +0000 (17:21 -0300)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Wed, 9 Dec 2020 12:51:51 +0000 (09:51 -0300)
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>
src/conf/domain_conf.c
src/conf/domain_validate.c
src/conf/domain_validate.h

index 072ced6e94ab3dce872326250bf9ad3f28965107..57a774e21aa62f5ae6dc9dbfc8e965e0282016f4 100644 (file)
@@ -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;
index bc5ca3f6689cde0f836a717725650c507da44f24..e9427cffa8bfdbba087bc6f4fefd6940c8f47a58 100644 (file)
@@ -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;
     }
 
index fe7c752e8ccdd494c21637db53fb362bc9c07563..aef169a4c908d596708eb8b352c26273357bd99d 100644 (file)
@@ -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);