[PATCH 031/103] qemuBuildDeviceAddressPCIStr: Make error messages easier to find

Peter Krempa posted 103 patches 4 years, 4 months ago
Only 102 patches received!
[PATCH 031/103] qemuBuildDeviceAddressPCIStr: Make error messages easier to find
Posted by Peter Krempa 4 years, 4 months ago
Per coding guidelines error messages should not be broken into lines and
variables should be separated by apostrophes.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_command.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index aeb04207b2..ee7a9f3060 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -345,9 +345,7 @@ qemuBuildDeviceAddressPCIStr(virBuffer *buf,

             if (!contAlias) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
-                               _("Device alias was not set for PCI "
-                                 "controller with index %u required "
-                                 "for device at address %s"),
+                               _("Device alias was not set for PCI controller with index '%u' required for device at address '%s'"),
                                info->addr.pci.bus, devStr);
                 return -1;
             }
@@ -372,9 +370,7 @@ qemuBuildDeviceAddressPCIStr(virBuffer *buf,

     if (!contAlias) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not find PCI "
-                         "controller with index %u required "
-                         "for device at address %s"),
+                       _("Could not find PCI controller with index '%u' required for device at address '%s'"),
                        info->addr.pci.bus, devStr);
         return -1;
     }
-- 
2.31.1

Re: [PATCH 031/103] qemuBuildDeviceAddressPCIStr: Make error messages easier to find
Posted by Ján Tomko 4 years, 4 months ago
On a Thursday in 2021, Peter Krempa wrote:
>Per coding guidelines error messages should not be broken into lines and
>variables should be separated by apostrophes.
>

https://libvirt.org/coding-style.html#error-message-format

>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_command.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano