conf: rename virDomainPCIAddressReserveSlot() to ...Addr()

This function doesn't actually reserve an entire slot any more, it
reserves a single PCI address, so this name is more appropriate.
This commit is contained in:
Laine Stump 2016-10-23 12:14:16 -04:00
parent 640ce18679
commit 27b0f971c4
5 changed files with 21 additions and 17 deletions

View File

@ -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; goto cleanup;
}
ret = 0; ret = 0;
cleanup: cleanup:
@ -94,8 +96,10 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def,
memset(&lpc_addr, 0, sizeof(lpc_addr)); memset(&lpc_addr, 0, sizeof(lpc_addr));
lpc_addr.slot = 0x1; 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; goto error;
}
for (i = 0; i < def->nnets; i++) { for (i = 0; i < def->nnets; i++) {
if (!virDeviceInfoPCIAddressWanted(&def->nets[i]->info)) if (!virDeviceInfoPCIAddressWanted(&def->nets[i]->info))

View File

@ -587,7 +587,7 @@ virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSetPtr addrs,
int int
virDomainPCIAddressReserveSlot(virDomainPCIAddressSetPtr addrs, virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr, virPCIDeviceAddressPtr addr,
virDomainPCIConnectFlags flags) virDomainPCIConnectFlags flags)
{ {

View File

@ -150,7 +150,7 @@ int virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs,
virDomainPCIConnectFlags flags) virDomainPCIConnectFlags flags)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int virDomainPCIAddressReserveSlot(virDomainPCIAddressSetPtr addrs, int virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr, virPCIDeviceAddressPtr addr,
virDomainPCIConnectFlags flags) virDomainPCIConnectFlags flags)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

View File

@ -100,8 +100,8 @@ virDomainPCIAddressBusSetModel;
virDomainPCIAddressEnsureAddr; virDomainPCIAddressEnsureAddr;
virDomainPCIAddressFlagsCompatible; virDomainPCIAddressFlagsCompatible;
virDomainPCIAddressReleaseSlot; virDomainPCIAddressReleaseSlot;
virDomainPCIAddressReserveAddr;
virDomainPCIAddressReserveNextAddr; virDomainPCIAddressReserveNextAddr;
virDomainPCIAddressReserveSlot;
virDomainPCIAddressSetAllMulti; virDomainPCIAddressSetAllMulti;
virDomainPCIAddressSetAlloc; virDomainPCIAddressSetAlloc;
virDomainPCIAddressSetFree; virDomainPCIAddressSetFree;

View File

@ -1034,7 +1034,7 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED,
} }
} }
if (virDomainPCIAddressReserveSlot(addrs, addr, if (virDomainPCIAddressReserveAddr(addrs, addr,
info->pciConnectFlags) < 0) { info->pciConnectFlags) < 0) {
goto cleanup; goto cleanup;
} }
@ -1188,7 +1188,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def,
if (addrs->nbuses) { if (addrs->nbuses) {
memset(&tmp_addr, 0, sizeof(tmp_addr)); memset(&tmp_addr, 0, sizeof(tmp_addr));
tmp_addr.slot = 1; tmp_addr.slot = 1;
if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0)
goto cleanup; goto cleanup;
} }
@ -1223,7 +1223,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def,
goto cleanup; goto cleanup;
} }
} else { } else {
if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0)
goto cleanup; goto cleanup;
primaryVideo->info.addr.pci = tmp_addr; primaryVideo->info.addr.pci = tmp_addr;
primaryVideo->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; primaryVideo->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
@ -1248,7 +1248,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def,
VIR_DEBUG("PCI address 0:0:2.0 in use, future addition of a video" VIR_DEBUG("PCI address 0:0:2.0 in use, future addition of a video"
" device will not be possible without manual" " device will not be possible without manual"
" intervention"); " intervention");
} else if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) { } else if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) {
goto cleanup; goto cleanup;
} }
} }
@ -1324,7 +1324,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
assign = true; assign = true;
} }
if (assign) { if (assign) {
if (virDomainPCIAddressReserveSlot(addrs, if (virDomainPCIAddressReserveAddr(addrs,
&tmp_addr, flags) < 0) { &tmp_addr, flags) < 0) {
goto cleanup; goto cleanup;
} }
@ -1349,7 +1349,7 @@ 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 (virDomainPCIAddressReserveSlot(addrs, if (virDomainPCIAddressReserveAddr(addrs,
&tmp_addr, flags) < 0) { &tmp_addr, flags) < 0) {
goto cleanup; goto cleanup;
} }
@ -1375,12 +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 (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 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 (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0)
goto cleanup; goto cleanup;
} }
@ -1414,7 +1414,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
goto cleanup; goto cleanup;
} }
} else { } else {
if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0)
goto cleanup; goto cleanup;
primaryVideo->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; primaryVideo->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
primaryVideo->info.addr.pci = tmp_addr; primaryVideo->info.addr.pci = tmp_addr;
@ -1440,7 +1440,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
" device will not be possible without manual" " device will not be possible without manual"
" intervention"); " intervention");
virResetLastError(); virResetLastError();
} else if (virDomainPCIAddressReserveSlot(addrs, } else if (virDomainPCIAddressReserveAddr(addrs,
&tmp_addr, flags) < 0) { &tmp_addr, flags) < 0) {
goto cleanup; goto cleanup;
} }
@ -1462,7 +1462,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
!virDeviceInfoPCIAddressWanted(&sound->info)) { !virDeviceInfoPCIAddressWanted(&sound->info)) {
continue; continue;
} }
if (virDomainPCIAddressReserveSlot(addrs, &tmp_addr, flags) < 0) if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0)
goto cleanup; goto cleanup;
sound->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; sound->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
@ -1678,7 +1678,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
if (foundAddr) { if (foundAddr) {
/* Reserve this function on the slot we found */ /* Reserve this function on the slot we found */
if (virDomainPCIAddressReserveSlot(addrs, &addr, if (virDomainPCIAddressReserveAddr(addrs, &addr,
cont->info.pciConnectFlags) < 0) { cont->info.pciConnectFlags) < 0) {
goto error; goto error;
} }