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 28b3604..e1cbe36 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -529,7 +529,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 653843f..f2cef4f 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 d978282..9a4db3b 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 57f3e2a..a9ba3b3 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -887,7 +887,7 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED, } } - if (virDomainPCIAddressReserveSlot(addrs, addr, + if (virDomainPCIAddressReserveAddr(addrs, addr, info->pciConnectFlags) < 0) { goto cleanup; } @@ -1074,7 +1074,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; } @@ -1109,7 +1109,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; @@ -1134,7 +1134,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; } } @@ -1210,7 +1210,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, assign = true; } if (assign) { - if (virDomainPCIAddressReserveSlot(addrs, + if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags) < 0) { goto cleanup; } @@ -1235,7 +1235,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; } @@ -1261,12 +1261,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; } @@ -1300,7 +1300,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; @@ -1326,7 +1326,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; } @@ -1348,7 +1348,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; @@ -1564,7 +1564,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 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list