提交 f35bbf7b 编写于 作者: M Marc-André Lureau 提交者: Daniel Veillard

qemu: don't reserve slot 1 if a PIIX3 USB controller is defined there

Applies only to piix3 and check if piix3 controller is on correct
address, or report error
上级 31710a53
......@@ -1091,6 +1091,7 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs)
{
int i;
bool reservedIDE = false;
bool reservedUSB = false;
bool reservedVGA = false;
int function;
......@@ -1122,6 +1123,13 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs)
def->controllers[i]->info.addr.pci.slot = 1;
def->controllers[i]->info.addr.pci.function = 1;
}
} else if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
def->controllers[i]->idx == 0 &&
def->controllers[i]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
def->controllers[i]->info.addr.pci.domain == 0 &&
def->controllers[i]->info.addr.pci.bus == 0 &&
def->controllers[i]->info.addr.pci.slot == 1) {
reservedUSB = true;
}
}
......@@ -1129,7 +1137,7 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs)
* hardcoded slot=1, multifunction device
*/
for (function = 0; function < QEMU_PCI_ADDRESS_LAST_FUNCTION; function++) {
if (function == 1 && reservedIDE)
if (function == 1 && (reservedIDE || reservedUSB))
/* we have reserved this pci address */
continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册