This function doesn't actually reserve an entire slot any more, it
reserves a single PCI address, so this name is more appropriate.
---
src/bhyve/bhyve_device.c | 8 ++++++--
src/conf/domain_addr.c | 2 +-
src/conf/domain_addr.h | 2 +-
src/libvirt_private.syms | 2 +-
src/qemu/qemu_domain_address.c | 24 ++++++++++++------------
5 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c
index 4a1e1bd..97e81e1 100644
--- a/src/bhyve/bhyve_device.c
+++ b/src/bhyve/bhyve_device.c
@@ -53,8 +53,10 @@ bhyveCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED,
}
}
- if (virDomainPCIAddressReserveSlot(addrs, addr, VIR_PCI_CONNECT_TYPE_PCI_DEVICE) <
0)
+ if (virDomainPCIAddressReserveAddr(addrs, addr,
+ VIR_PCI_CONNECT_TYPE_PCI_DEVICE) < 0) {
goto cleanup;
+ }
ret = 0;
cleanup:
@@ -94,8 +96,10 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def,
memset(&lpc_addr, 0, sizeof(lpc_addr));
lpc_addr.slot = 0x1;
- if (virDomainPCIAddressReserveSlot(addrs, &lpc_addr,
VIR_PCI_CONNECT_TYPE_PCI_DEVICE) < 0)
+ if (virDomainPCIAddressReserveAddr(addrs, &lpc_addr,
+ VIR_PCI_CONNECT_TYPE_PCI_DEVICE) < 0) {
goto error;
+ }
for (i = 0; i < def->nnets; i++) {
if (!virDeviceInfoPCIAddressWanted(&def->nets[i]->info))
diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index 24e3c7d..345c274 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -587,7 +587,7 @@ virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSetPtr
addrs,
int
-virDomainPCIAddressReserveSlot(virDomainPCIAddressSetPtr addrs,
+virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr,
virDomainPCIConnectFlags flags)
{
diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h
index 2412ed3..dac73fa 100644
--- a/src/conf/domain_addr.h
+++ b/src/conf/domain_addr.h
@@ -150,7 +150,7 @@ int virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs,
virDomainPCIConnectFlags flags)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-int virDomainPCIAddressReserveSlot(virDomainPCIAddressSetPtr addrs,
+int virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr,
virDomainPCIConnectFlags flags)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 04823d2..1f54ea4 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -101,8 +101,8 @@ virDomainPCIAddressEnsureAddr;
virDomainPCIAddressFlagsCompatible;
virDomainPCIAddressIsMulti;
virDomainPCIAddressReleaseSlot;
+virDomainPCIAddressReserveAddr;
virDomainPCIAddressReserveNextAddr;
-virDomainPCIAddressReserveSlot;
virDomainPCIAddressSetAlloc;
virDomainPCIAddressSetFree;
virDomainPCIAddressSetGrow;
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 9a78504..4673cc7 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -989,7 +989,7 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED,
}
}
- if (virDomainPCIAddressReserveSlot(addrs, addr,
+ if (virDomainPCIAddressReserveAddr(addrs, addr,
info->pciConnectFlags) < 0) {
goto cleanup;
}
@@ -1143,7 +1143,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def,
if (addrs->nbuses) {
memset(&tmp_addr, 0, sizeof(tmp_addr));
tmp_addr.slot = 1;
- if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0)
+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0)
goto cleanup;
}
@@ -1178,7 +1178,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def,
goto cleanup;
}
} else {
- if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0)
+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0)
goto cleanup;
primaryVideo->info.addr.pci = tmp_addr;
primaryVideo->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
@@ -1203,7 +1203,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def,
VIR_DEBUG("PCI address 0:0:2.0 in use, future addition of a video"
" device will not be possible without manual"
" intervention");
- } else if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) {
+ } else if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) {
goto cleanup;
}
}
@@ -1279,7 +1279,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
assign = true;
}
if (assign) {
- if (virDomainPCIAddressReserveSlot(addrs,
+ if (virDomainPCIAddressReserveAddr(addrs,
&tmp_addr, flags) < 0) {
goto cleanup;
}
@@ -1304,7 +1304,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
memset(&tmp_addr, 0, sizeof(tmp_addr));
tmp_addr.slot = 0x1E;
if (!virDomainPCIAddressSlotInUse(addrs, &tmp_addr)) {
- if (virDomainPCIAddressReserveSlot(addrs,
+ if (virDomainPCIAddressReserveAddr(addrs,
&tmp_addr, flags) < 0) {
goto cleanup;
}
@@ -1330,12 +1330,12 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
tmp_addr.slot = 0x1F;
tmp_addr.function = 0;
tmp_addr.multi = VIR_TRISTATE_SWITCH_ON;
- if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0)
+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0)
goto cleanup;
tmp_addr.function = 3;
tmp_addr.multi = VIR_TRISTATE_SWITCH_ABSENT;
- if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0)
+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0)
goto cleanup;
}
@@ -1369,7 +1369,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
goto cleanup;
}
} else {
- if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0)
+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0)
goto cleanup;
primaryVideo->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
primaryVideo->info.addr.pci = tmp_addr;
@@ -1395,7 +1395,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
" device will not be possible without manual"
" intervention");
virResetLastError();
- } else if (virDomainPCIAddressReserveSlot(addrs,
+ } else if (virDomainPCIAddressReserveAddr(addrs,
&tmp_addr, flags) < 0) {
goto cleanup;
}
@@ -1417,7 +1417,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
!virDeviceInfoPCIAddressWanted(&sound->info)) {
continue;
}
- if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0)
+ if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0)
goto cleanup;
sound->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
@@ -1633,7 +1633,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
if (foundAddr) {
/* Reserve this function on the slot we found */
- if (virDomainPCIAddressReserveSlot(addrs, &addr,
+ if (virDomainPCIAddressReserveAddr(addrs, &addr,
cont->info.pciConnectFlags) < 0)
{
goto error;
}
--
2.7.4