From c7289cf3b59aacd08dbc9047eda52c03b2837653 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: May 26 2016 14:24:04 +0000 Subject: 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 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 --- diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index e9619a2..ca3adc0 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -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; }