提交 905859a6 编写于 作者: L Laine Stump

qemu: replace virDomainPCIAddressReserveAddr with virDomainPCIAddressReserveSlot

All occurences of the former use fromConfig=true, and that's exactly
how virDomainPCIAddressReserveSlot() calls
virDomainPCIaddressReserveAddr(), so just use *Slot() so that *Addr()
can be made static to conf/domain_addr.c (both functions will be
renamed in upcoming patches).
上级 43f81477
...@@ -1034,8 +1034,8 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED, ...@@ -1034,8 +1034,8 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED,
} }
} }
if (virDomainPCIAddressReserveAddr(addrs, addr, if (virDomainPCIAddressReserveSlot(addrs, addr,
info->pciConnectFlags, true) < 0) { info->pciConnectFlags) < 0) {
goto cleanup; goto cleanup;
} }
...@@ -1324,9 +1324,11 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, ...@@ -1324,9 +1324,11 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
assign = true; assign = true;
} }
if (assign) { if (assign) {
if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, if (virDomainPCIAddressReserveSlot(addrs,
flags, true) < 0) &tmp_addr, flags) < 0) {
goto cleanup; goto cleanup;
}
cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
cont->info.addr.pci.domain = 0; cont->info.addr.pci.domain = 0;
cont->info.addr.pci.bus = 0; cont->info.addr.pci.bus = 0;
...@@ -1347,9 +1349,11 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, ...@@ -1347,9 +1349,11 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
memset(&tmp_addr, 0, sizeof(tmp_addr)); memset(&tmp_addr, 0, sizeof(tmp_addr));
tmp_addr.slot = 0x1E; tmp_addr.slot = 0x1E;
if (!virDomainPCIAddressSlotInUse(addrs, &tmp_addr)) { if (!virDomainPCIAddressSlotInUse(addrs, &tmp_addr)) {
if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, if (virDomainPCIAddressReserveSlot(addrs,
flags, true) < 0) &tmp_addr, flags) < 0) {
goto cleanup; goto cleanup;
}
cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
cont->info.addr.pci.domain = 0; cont->info.addr.pci.domain = 0;
cont->info.addr.pci.bus = 0; cont->info.addr.pci.bus = 0;
...@@ -1371,13 +1375,12 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, ...@@ -1371,13 +1375,12 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
tmp_addr.slot = 0x1F; tmp_addr.slot = 0x1F;
tmp_addr.function = 0; tmp_addr.function = 0;
tmp_addr.multi = VIR_TRISTATE_SWITCH_ON; tmp_addr.multi = VIR_TRISTATE_SWITCH_ON;
if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0)
flags, true) < 0)
goto cleanup; goto cleanup;
tmp_addr.function = 3; tmp_addr.function = 3;
tmp_addr.multi = VIR_TRISTATE_SWITCH_ABSENT; tmp_addr.multi = VIR_TRISTATE_SWITCH_ABSENT;
if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0)
flags, true) < 0)
goto cleanup; goto cleanup;
} }
...@@ -1675,10 +1678,10 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, ...@@ -1675,10 +1678,10 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
if (foundAddr) { if (foundAddr) {
/* Reserve this function on the slot we found */ /* Reserve this function on the slot we found */
if (virDomainPCIAddressReserveAddr(addrs, &addr, if (virDomainPCIAddressReserveSlot(addrs, &addr,
cont->info.pciConnectFlags, cont->info.pciConnectFlags) < 0) {
true) < 0)
goto error; goto error;
}
cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
cont->info.addr.pci = addr; cont->info.addr.pci = addr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册