[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] qemu: Fix error message when PCI bridge has index <= bus



Commit ff2126225df0 changed the error message to be more
detailed about the failure at hand; however, while the new
error message claims that "bus must be <= index", the error
message is displayed if "idx <= addr->bus", ie. when bus
is bigger than or *equal to* index.

Change the error message to report the correct constraint,
and format it in a way that mirrors the check exactly to
make it clearer to people reading the code. The new error
message reads "must be index > bus".
---
I'm assuming the code, which is pre-existing, is correct
here. CC'ing Laine for insights.

 src/qemu/qemu_domain_address.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 7bd8ee5..650cb2a 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -1598,14 +1598,14 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
                 break;
             }
 
-            /* check if every PCI bridge controller's ID is greater than
+            /* check if every PCI bridge controller's index is greater than
              * the bus it is placed onto
              */
             if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE &&
                 idx <= addr->bus) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                                _("PCI controller at index %d (0x%02x) has "
-                                 "bus='0x%02x', but bus must be <= index"),
+                                 "bus='0x%02x'; must be index > bus"),
                                idx, idx, addr->bus);
                 goto cleanup;
             }
-- 
2.5.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]