Since we don't actually reserve an entire slot at a time anymore, the name of this function is just confusing, and it's almost identical in operation to virDomainPCIAddressReserveNextAddr() anyway, so remove the *Slot() function and replace calls to it with calls to *Addr(..., -1). --- src/bhyve/bhyve_device.c | 18 ++++++++++-------- src/conf/domain_addr.c | 11 +---------- src/conf/domain_addr.h | 5 ----- src/libvirt_private.syms | 1 - 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index ca30e9f..4a1e1bd 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -100,19 +100,20 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, for (i = 0; i < def->nnets; i++) { if (!virDeviceInfoPCIAddressWanted(&def->nets[i]->info)) continue; - if (virDomainPCIAddressReserveNextSlot(addrs, - &def->nets[i]->info, - VIR_PCI_CONNECT_TYPE_PCI_DEVICE) < 0) + if (virDomainPCIAddressReserveNextAddr(addrs, &def->nets[i]->info, + VIR_PCI_CONNECT_TYPE_PCI_DEVICE, + -1) < 0) { goto error; + } } for (i = 0; i < def->ndisks; i++) { if (def->disks[i]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && !virPCIDeviceAddressIsEmpty(&def->disks[i]->info.addr.pci)) continue; - if (virDomainPCIAddressReserveNextSlot(addrs, - &def->disks[i]->info, - VIR_PCI_CONNECT_TYPE_PCI_DEVICE) < 0) + if (virDomainPCIAddressReserveNextAddr(addrs, &def->disks[i]->info, + VIR_PCI_CONNECT_TYPE_PCI_DEVICE, + -1) < 0) goto error; } @@ -122,9 +123,10 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, !virDeviceInfoPCIAddressWanted(&def->controllers[i]->info)) continue; - if (virDomainPCIAddressReserveNextSlot(addrs, + if (virDomainPCIAddressReserveNextAddr(addrs, &def->controllers[i]->info, - VIR_PCI_CONNECT_TYPE_PCI_DEVICE) < 0) + VIR_PCI_CONNECT_TYPE_PCI_DEVICE, + -1) < 0) goto error; } diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index a27ba41..8f64bef 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -571,7 +571,7 @@ virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs, ret = virDomainPCIAddressReserveAddr(addrs, &dev->addr.pci, flags, true); } else { - ret = virDomainPCIAddressReserveNextSlot(addrs, dev, flags); + ret = virDomainPCIAddressReserveNextAddr(addrs, dev, flags, -1); } cleanup: @@ -839,15 +839,6 @@ virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, } -int -virDomainPCIAddressReserveNextSlot(virDomainPCIAddressSetPtr addrs, - virDomainDeviceInfoPtr dev, - virDomainPCIConnectFlags flags) -{ - return virDomainPCIAddressReserveNextAddr(addrs, dev, flags, -1); -} - - typedef struct { virPCIDeviceAddressPtr addr; bool isMulti; diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index 705e033..fcb622d 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -180,11 +180,6 @@ int virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, int function) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virDomainPCIAddressReserveNextSlot(virDomainPCIAddressSetPtr addrs, - virDomainDeviceInfoPtr dev, - virDomainPCIConnectFlags flags) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - bool virDomainPCIAddressIsMulti(const virDomainDef *def, virPCIDeviceAddressPtr addr) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 104d43e..b814e83 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -103,7 +103,6 @@ virDomainPCIAddressIsMulti; virDomainPCIAddressReleaseSlot; virDomainPCIAddressReserveAddr; virDomainPCIAddressReserveNextAddr; -virDomainPCIAddressReserveNextSlot; virDomainPCIAddressReserveSlot; virDomainPCIAddressSetAlloc; virDomainPCIAddressSetFree; -- 2.7.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list