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 745ec1b..57f3e2a 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -887,8 +887,8 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED,
}
}
- if (virDomainPCIAddressReserveAddr(addrs, addr,
- info->pciConnectFlags, true) < 0) {
+ if (virDomainPCIAddressReserveSlot(addrs, addr,
+ info->pciConnectFlags) < 0) {
goto cleanup;
}
@@ -1210,9 +1210,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;
@@ -1233,9 +1235,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;
@@ -1257,13 +1261,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;
}
@@ -1561,10 +1564,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