]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Fix error message when PCI bridge has index <= bus
authorAndrea Bolognani <abologna@redhat.com>
Mon, 23 May 2016 16:00:36 +0000 (18:00 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 26 May 2016 14:24:04 +0000 (16:24 +0200)
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 larger 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 "index must be larger than bus".

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1339900

src/qemu/qemu_domain_address.c

index e9619a246a4dcf00d6d7167658da27bbfc967925..ca3adc0b72f757f43698f02895715b0791722aef 100644 (file)
@@ -1587,14 +1587,15 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
                 break;
             }
 
-            /* check if every PCI bridge controller's ID is greater than
+            /* check if every PCI bridge controller's index is larger 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', but index must be "
+                                 "larger than bus"),
                                idx, idx, addr->bus);
                 goto cleanup;
             }