diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 9edfc5c2d8042cd0f642c5af98c5529dc6115586..c4485d4ab57c6a765d5310305e29e260f52e1801 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1429,15 +1429,24 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def, cont->info.addr.pci.slot = 1; cont->info.addr.pci.function = 2; } + } else { + /* this controller is not skipped in qemuDomainCollectPCIAddress */ + continue; } + if (addrs->nbuses && + virDomainPCIAddressReserveAddr(addrs, &cont->info.addr.pci, flags, 0) < 0) + goto cleanup; } - /* PIIX3 (ISA bridge, IDE controller, something else unknown, USB controller) - * hardcoded slot=1, multifunction device - */ + /* Implicit PIIX3 devices living on slot 1 not handled above */ if (addrs->nbuses) { memset(&tmp_addr, 0, sizeof(tmp_addr)); tmp_addr.slot = 1; + /* ISA Bridge at 00:01.0 */ + if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0) + goto cleanup; + /* Bridge at 00:01.3 */ + tmp_addr.function = 3; if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0) goto cleanup; } diff --git a/tests/qemuxml2argvdata/qemuxml2argv-440fx-ide-address-conflict.xml b/tests/qemuxml2argvdata/qemuxml2argv-440fx-ide-address-conflict.xml new file mode 100644 index 0000000000000000000000000000000000000000..4195880aace55aae09806b08196ec44c122cbb63 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-440fx-ide-address-conflict.xml @@ -0,0 +1,25 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + + + +
+ + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index a505864b87e0b0ae990e9222b2eae158bec71bfd..01e7d6f6a9eef9dd82ff2ead23ba8edfaf65e947 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2259,6 +2259,7 @@ mymain(void) QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL); DO_TEST_PARSE_ERROR("440fx-wrong-root", NONE); + DO_TEST_PARSE_ERROR("440fx-ide-address-conflict", NONE); DO_TEST_PARSE_ERROR("pcie-root-port-too-many", QEMU_CAPS_DEVICE_IOH3420,