提交 deff02a3 编写于 作者: W Wen Congyang

reserve slot 1 on pci bus0

After supporting multi function pci device, we only reserve function 1 on slot 1.
The user can use the other function on slot 1 in the xml config file. We should
detect this wrong usage.
上级 bf712018
...@@ -1072,6 +1072,7 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs) ...@@ -1072,6 +1072,7 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs)
int i; int i;
bool reservedIDE = false; bool reservedIDE = false;
bool reservedVGA = false; bool reservedVGA = false;
int function;
/* Host bridge */ /* Host bridge */
if (qemuDomainPCIAddressReserveSlot(addrs, 0) < 0) if (qemuDomainPCIAddressReserveSlot(addrs, 0) < 0)
...@@ -1107,9 +1108,14 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs) ...@@ -1107,9 +1108,14 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs)
/* PIIX3 (ISA bridge, IDE controller, something else unknown, USB controller) /* PIIX3 (ISA bridge, IDE controller, something else unknown, USB controller)
* hardcoded slot=1, multifunction device * hardcoded slot=1, multifunction device
*/ */
if (!reservedIDE && for (function = 0; function < QEMU_PCI_ADDRESS_LAST_FUNCTION; function++) {
qemuDomainPCIAddressReserveSlot(addrs, 1) < 0) if (function == 1 && reservedIDE)
goto error; /* we have reserved this pci address */
continue;
if (qemuDomainPCIAddressReserveFunction(addrs, 1, function) < 0)
goto error;
}
/* First VGA is hardcoded slot=2 */ /* First VGA is hardcoded slot=2 */
if (def->nvideos > 0) { if (def->nvideos > 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册