Standardize error messages to use the exact XML attribute and element
names (enclosed in single quotes) as defined in the domain XML schema.

Suggested-by: Peter Krempa <[email protected]>
Signed-off-by: Zhenzhong Duan <[email protected]>
---
 src/conf/domain_conf.c     | 32 ++++++++++++++++----------------
 src/conf/domain_validate.c |  4 ++--
 src/qemu/qemu_validate.c   | 26 +++++++++++++-------------
 3 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 61f3b47773..cde8c71474 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -22762,83 +22762,83 @@ virDomainIOMMUDefCheckABIStability(virDomainIOMMUDef 
*src,
     }
     if (src->intremap != dst->intremap) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device intremap value '%1$s' 
does not match source '%2$s'"),
+                       _("Target domain IOMMU device 'intremap' value '%1$s' 
does not match source '%2$s'"),
                        virTristateSwitchTypeToString(dst->intremap),
                        virTristateSwitchTypeToString(src->intremap));
         return false;
     }
     if (src->caching_mode != dst->caching_mode) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device caching mode '%1$s' does 
not match source '%2$s'"),
+                       _("Target domain IOMMU device 'caching_mode' '%1$s' 
does not match source '%2$s'"),
                        virTristateSwitchTypeToString(dst->caching_mode),
                        virTristateSwitchTypeToString(src->caching_mode));
         return false;
     }
     if (src->eim != dst->eim) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device eim value '%1$s' does not 
match source '%2$s'"),
+                       _("Target domain IOMMU device 'eim' value '%1$s' does 
not match source '%2$s'"),
                        virTristateSwitchTypeToString(dst->eim),
                        virTristateSwitchTypeToString(src->eim));
         return false;
     }
     if (src->iotlb != dst->iotlb) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device iotlb value '%1$s' does 
not match source '%2$s'"),
+                       _("Target domain IOMMU device 'iotlb' value '%1$s' does 
not match source '%2$s'"),
                        virTristateSwitchTypeToString(dst->iotlb),
                        virTristateSwitchTypeToString(src->iotlb));
         return false;
     }
     if (src->aw_bits != dst->aw_bits) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device aw_bits value '%1$u' does 
not match source '%2$u'"),
+                       _("Target domain IOMMU device 'aw_bits' value '%1$u' 
does not match source '%2$u'"),
                        dst->aw_bits, src->aw_bits);
         return false;
     }
     if (src->pci_bus != dst->pci_bus) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device pci_bus value '%1$d' does 
not match source '%2$d'"),
+                       _("Target domain IOMMU device 'pciBus' value '%1$d' 
does not match source '%2$d'"),
                        dst->pci_bus, src->pci_bus);
         return false;
     }
     if (src->accel != dst->accel) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device accel value '%1$d' does 
not match source '%2$d'"),
+                       _("Target domain IOMMU device 'accel' value '%1$d' does 
not match source '%2$d'"),
                        dst->accel, src->accel);
         return false;
     }
     if (src->cmdqv != dst->cmdqv) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device cmdqv value '%1$d' does 
not match source '%2$d'"),
+                       _("Target domain IOMMU device 'cmdqv' value '%1$d' does 
not match source '%2$d'"),
                        dst->cmdqv, src->cmdqv);
         return false;
     }
     if (src->ats != dst->ats) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device ATS value '%1$d' does not 
match source '%2$d'"),
+                       _("Target domain IOMMU device 'ats' value '%1$d' does 
not match source '%2$d'"),
                        dst->ats, src->ats);
         return false;
     }
     if (src->ril != dst->ril) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device ril value '%1$d' does not 
match source '%2$d'"),
+                       _("Target domain IOMMU device 'ril' value '%1$d' does 
not match source '%2$d'"),
                        dst->ril, src->ril);
         return false;
     }
     if (src->ssid_size != dst->ssid_size) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device ssid_size value '%1$d' 
does not match source '%2$d'"),
+                       _("Target domain IOMMU device 'ssidsize' value '%1$d' 
does not match source '%2$d'"),
                        dst->ssid_size, src->ssid_size);
         return false;
     }
     if (src->oas != dst->oas) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device oas value '%1$d' does not 
match source '%2$d'"),
+                       _("Target domain IOMMU device 'oas' value '%1$d' does 
not match source '%2$d'"),
                        dst->oas, src->oas);
         return false;
     }
     if (src->dma_translation != dst->dma_translation) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device dma translation '%1$s' 
does not match source '%2$s'"),
+                       _("Target domain IOMMU device 'dma_translation' '%1$s' 
does not match source '%2$s'"),
                        virTristateSwitchTypeToString(dst->dma_translation),
                        virTristateSwitchTypeToString(src->dma_translation));
         return false;
@@ -22872,14 +22872,14 @@ virDomainIOMMUDefCheckABIStability(virDomainIOMMUDef 
*src,
     }
     if (src->pt != dst->pt) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device passthrough '%1$s' does 
not match source '%2$s'"),
+                       _("Target domain IOMMU device 'passthrough' '%1$s' does 
not match source '%2$s'"),
                        virTristateSwitchTypeToString(dst->pt),
                        virTristateSwitchTypeToString(src->pt));
         return false;
     }
     if (src->xtsup != dst->xtsup) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device xtsup '%1$s' does not 
match source '%2$s'"),
+                       _("Target domain IOMMU device 'xtsup' '%1$s' does not 
match source '%2$s'"),
                        virTristateSwitchTypeToString(dst->xtsup),
                        virTristateSwitchTypeToString(src->xtsup));
         return false;
@@ -22889,7 +22889,7 @@ virDomainIOMMUDefCheckABIStability(virDomainIOMMUDef 
*src,
         g_autofree char *dst_granule = 
virDomainIOMMUGranuleModeTypeToString(dst->granule);
 
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Target domain IOMMU device granule '%1$s' does not 
match source '%2$s'"),
+                       _("Target domain IOMMU device 'granule' '%1$s' does not 
match source '%2$s'"),
                        dst_granule,
                        src_granule);
         return false;
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index 0d52f4ca35..cef844aead 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -3221,7 +3221,7 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu)
              iommu->ssid_size >= 0 ||
              iommu->oas >= 0)) {
             virReportError(VIR_ERR_XML_ERROR,
-                           _("accel must be enabled for iommu model '%1$s' 
when setting ats, ril, ssidsize, oas, or cmdqv"),
+                           _("'accel' must be enabled for iommu model '%1$s' 
when setting ats, ril, ssidsize, oas, or cmdqv"),
                            virDomainIOMMUModelTypeToString(iommu->model));
             return -1;
         }
@@ -3254,7 +3254,7 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu)
          * be assumed to be hypervisor agnostic and thus can live here. */
         if (iommu->aw_bits != 0 && (iommu->aw_bits < 32 || iommu->aw_bits > 
64)) {
             virReportError(VIR_ERR_XML_ERROR, "%s",
-                           _("aw-bits must be within [32,64]"));
+                           _("'aw_bits' must be within [32,64]"));
             return -1;
         }
         break;
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index bbd59a314a..24f01c36e1 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -2824,13 +2824,13 @@ qemuValidateDomainDeviceDefHostdev(const 
virDomainHostdevDef *hostdev,
                 if (virHostdevIsPCIDeviceWithIOMMUFD(hostdev)) {
                     if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_IOMMUFD)) {
                         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                                       _("IOMMUFD is not supported by this 
version of qemu"));
+                                       _("'iommufd' is not supported by this 
version of qemu"));
                         return -1;
                     }
 
                     if (!virIOMMUFDSupported()) {
                         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                                       _("IOMMUFD is not supported by host 
kernel"));
+                                       _("'iommufd' is not supported by host 
kernel"));
                         return -1;
                     }
                 } else if (virDomainDefHasIntelIOMMUWithFSTS(def)) {
@@ -5735,7 +5735,7 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef 
*iommu,
         if (iommu->pci_bus >= 0) {
             if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_ARM_SMMUV3_SMMU_PER_BUS)) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                               _("IOMMU device: Setting pciBus for '%1$s' is 
not supported with this QEMU binary"),
+                               _("IOMMU device: Setting 'pciBus' for '%1$s' is 
not supported with this QEMU binary"),
                                virDomainIOMMUModelTypeToString(iommu->model));
                 return -1;
             }
@@ -5815,36 +5815,36 @@ qemuValidateDomainDeviceDefIOMMU(const 
virDomainIOMMUDef *iommu,
     if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT &&
         !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_INTREMAP)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("iommu: interrupt remapping is not supported with 
this QEMU binary"));
+                       _("iommu: 'intremap' is not supported with this QEMU 
binary"));
         return -1;
     }
     if (iommu->caching_mode != VIR_TRISTATE_SWITCH_ABSENT &&
         !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_CACHING_MODE))  {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("iommu: caching mode is not supported with this QEMU 
binary"));
+                       _("iommu: 'caching_mode' is not supported with this 
QEMU binary"));
         return -1;
     }
     if (iommu->eim != VIR_TRISTATE_SWITCH_ABSENT &&
         !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_EIM))  {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("iommu: eim is not supported with this QEMU binary"));
+                       _("iommu: 'eim' is not supported with this QEMU 
binary"));
         return -1;
     }
     if (iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT &&
         !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("iommu: device IOTLB is not supported with this QEMU 
binary"));
+                       _("iommu: 'iotlb' is not supported with this QEMU 
binary"));
         return -1;
     }
     if (iommu->aw_bits > 0 && !aw_bits_supported) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("iommu: aw_bits is not supported with this QEMU 
binary"));
+                       _("iommu: 'aw_bits' is not supported with this QEMU 
binary"));
         return -1;
     }
     if (iommu->dma_translation != VIR_TRISTATE_SWITCH_ABSENT &&
         !virQEMUCapsGet(qemuCaps, QEMU_CAPS_INTEL_IOMMU_DMA_TRANSLATION))  {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("iommu: updating dma translation is not supported 
with this QEMU binary"));
+                       _("iommu: updating 'dma_translation' is not supported 
with this QEMU binary"));
         return -1;
     }
     if (iommu->scalable_mode != VIR_TRISTATE_SWITCH_ABSENT &&
@@ -5885,7 +5885,7 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef 
*iommu,
         iommu->accel != VIR_TRISTATE_SWITCH_ABSENT &&
         !virQEMUCapsGet(qemuCaps, QEMU_CAPS_ARM_SMMUV3_ACCEL)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("iommu: accel is not supported with this QEMU 
binary"));
+                       _("iommu: 'accel' is not supported with this QEMU 
binary"));
         return -1;
     }
 
@@ -5893,7 +5893,7 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef 
*iommu,
         iommu->cmdqv != VIR_TRISTATE_SWITCH_ABSENT &&
         !virQEMUCapsGet(qemuCaps, QEMU_CAPS_ARM_SMMUV3_CMDQV)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("iommu: cmdqv is not supported with this QEMU 
binary"));
+                       _("iommu: 'cmdqv' is not supported with this QEMU 
binary"));
         return -1;
     }
 
@@ -5904,7 +5904,7 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef 
*iommu,
               iommu->granule == 16 ||
               iommu->granule == 64)) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("iommu: unsupported granule size. Supported 
values are 4, 8, 16 and 64 KiB"));
+                           _("iommu: unsupported 'granule' size. Supported 
values are 4, 8, 16 and 64 KiB"));
             return -1;
         }
 
@@ -5915,7 +5915,7 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef 
*iommu,
          * other makes no sense. */
         if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_IOMMU_AW_BITS)) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("iommu: page granule is not supported with this 
QEMU binary"));
+                           _("iommu: page 'granule' is not supported with this 
QEMU binary"));
             return -1;
         }
     }
-- 
2.52.0

Reply via email to