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).
---
src/qemu/qemu_domain_address.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 59dbe22..9a78504 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -989,8 +989,8 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED,
}
}
- if (virDomainPCIAddressReserveAddr(addrs, addr,
- info->pciConnectFlags, true) < 0) {
+ if (virDomainPCIAddressReserveSlot(addrs, addr,
+ info->pciConnectFlags) < 0) {
goto cleanup;
}
@@ -1279,9 +1279,11 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
assign = true;
}
if (assign) {
- if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr,
- flags, true) < 0)
+ if (virDomainPCIAddressReserveSlot(addrs,
+ &tmp_addr, flags) < 0) {
goto cleanup;
+ }
+
cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
cont->info.addr.pci.domain = 0;
cont->info.addr.pci.bus = 0;
@@ -1302,9 +1304,11 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
memset(&tmp_addr, 0, sizeof(tmp_addr));
tmp_addr.slot = 0x1E;
if (!virDomainPCIAddressSlotInUse(addrs, &tmp_addr)) {
- if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr,
- flags, true) < 0)
+ if (virDomainPCIAddressReserveSlot(addrs,
+ &tmp_addr, flags) < 0) {
goto cleanup;
+ }
+
cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
cont->info.addr.pci.domain = 0;
cont->info.addr.pci.bus = 0;
@@ -1326,13 +1330,12 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
tmp_addr.slot = 0x1F;
tmp_addr.function = 0;
tmp_addr.multi = VIR_TRISTATE_SWITCH_ON;
- if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr,
- flags, true) < 0)
+ if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0)
goto cleanup;
+
tmp_addr.function = 3;
tmp_addr.multi = VIR_TRISTATE_SWITCH_ABSENT;
- if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr,
- flags, true) < 0)
+ if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0)
goto cleanup;
}
@@ -1630,10 +1633,10 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
if (foundAddr) {
/* Reserve this function on the slot we found */
- if (virDomainPCIAddressReserveAddr(addrs, &addr,
- cont->info.pciConnectFlags,
- true) < 0)
+ if (virDomainPCIAddressReserveSlot(addrs, &addr,
+ cont->info.pciConnectFlags) < 0)
{
goto error;
+ }
cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
cont->info.addr.pci = addr;
--
2.7.4