Since address sets are now recalculated on demand instead of being cached, there's no need for functions that release addresses. --- src/conf/domain_addr.c | 92 ------------------------------------------------ src/conf/domain_addr.h | 12 ------- src/libvirt_private.syms | 3 -- 3 files changed, 107 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index fc3b9be..67c12a4 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -505,30 +505,6 @@ virDomainPCIAddressReleaseAddr(virDomainPCIAddressSetPtr addrs, return 0; } -int -virDomainPCIAddressReleaseSlot(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) -{ - /* permit any kind of connection type in validation, since we - * already had it, and are giving it back. - */ - virDomainPCIConnectFlags flags = VIR_PCI_CONNECT_TYPES_MASK; - int ret = -1; - char *addrStr = NULL; - - if (!(addrStr = virDomainPCIAddressAsString(addr))) - goto cleanup; - - if (!virDomainPCIAddressValidate(addrs, addr, addrStr, flags, false)) - goto cleanup; - - addrs->buses[addr->bus].slots[addr->slot] = 0; - ret = 0; - cleanup: - VIR_FREE(addrStr); - return ret; -} - virDomainPCIAddressSetPtr virDomainPCIAddressSetAlloc(unsigned int nbuses) @@ -781,30 +757,6 @@ virDomainCCWAddressValidate(virDomainDefPtr def ATTRIBUTE_UNUSED, return virDomainCCWAddressAssign(info, data, false); } -int -virDomainCCWAddressReleaseAddr(virDomainCCWAddressSetPtr addrs, - virDomainDeviceInfoPtr dev) -{ - char *addr; - int ret; - - addr = virDomainCCWAddressAsString(&(dev->addr.ccw)); - if (!addr) - return -1; - - if ((ret = virHashRemoveEntry(addrs->defined, addr)) == 0 && - dev->addr.ccw.cssid == addrs->next.cssid && - dev->addr.ccw.ssid == addrs->next.ssid && - dev->addr.ccw.devno < addrs->next.devno) { - addrs->next.devno = dev->addr.ccw.devno; - addrs->next.assigned = false; - } - - VIR_FREE(addr); - - return ret; -} - void virDomainCCWAddressSetFree(virDomainCCWAddressSetPtr addrs) { if (!addrs) @@ -1238,47 +1190,3 @@ virDomainVirtioSerialAddrReserve(virDomainDefPtr def ATTRIBUTE_UNUSED, VIR_FREE(str); return ret; } - -/* virDomainVirtioSerialAddrRelease - * - * Release the virtio serial address of the device - */ -int -virDomainVirtioSerialAddrRelease(virDomainVirtioSerialAddrSetPtr addrs, - virDomainDeviceInfoPtr info) -{ - virBitmapPtr map; - char *str = NULL; - int ret = -1; - ssize_t i; - - if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL || - info->addr.vioserial.port == 0) - return 0; - - VIR_DEBUG("Releasing virtio serial %u %u", info->addr.vioserial.controller, - info->addr.vioserial.port); - - i = virDomainVirtioSerialAddrFindController(addrs, info->addr.vioserial.controller); - if (i < 0) { - virReportError(VIR_ERR_XML_ERROR, - _("virtio serial controller %u is missing"), - info->addr.vioserial.controller); - goto cleanup; - } - - map = addrs->controllers[i]->ports; - if (virBitmapClearBit(map, info->addr.vioserial.port) < 0) { - virReportError(VIR_ERR_XML_ERROR, - _("virtio serial controller %u does not have port %u"), - info->addr.vioserial.controller, - info->addr.vioserial.port); - goto cleanup; - } - - ret = 0; - - cleanup: - VIR_FREE(str); - return ret; -} diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index 73d7474..a060683 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -143,10 +143,6 @@ int virDomainPCIAddressReleaseAddr(virDomainPCIAddressSetPtr addrs, virPCIDeviceAddressPtr addr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virDomainPCIAddressReleaseSlot(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - int virDomainPCIAddressGetNextSlot(virDomainPCIAddressSetPtr addrs, virPCIDeviceAddressPtr next_addr, virDomainPCIConnectFlags flags) @@ -180,9 +176,6 @@ int virDomainCCWAddressValidate(virDomainDefPtr def, void *data) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -int virDomainCCWAddressReleaseAddr(virDomainCCWAddressSetPtr addrs, - virDomainDeviceInfoPtr dev) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); virDomainCCWAddressSetPtr virDomainCCWAddressSetCreate(void); struct _virDomainVirtioSerialController { @@ -235,9 +228,4 @@ virDomainVirtioSerialAddrReserve(virDomainDefPtr def, void *data) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -int -virDomainVirtioSerialAddrRelease(virDomainVirtioSerialAddrSetPtr addrs, - virDomainDeviceInfoPtr info) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - #endif /* __DOMAIN_ADDR_H__ */ diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index f0a904c..bdf8304 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -87,7 +87,6 @@ virPCIDeviceAddressParseXML; # conf/domain_addr.h virDomainCCWAddressAllocate; virDomainCCWAddressAssign; -virDomainCCWAddressReleaseAddr; virDomainCCWAddressSetCreate; virDomainCCWAddressSetFree; virDomainCCWAddressValidate; @@ -97,7 +96,6 @@ virDomainPCIAddressBusSetModel; virDomainPCIAddressEnsureAddr; virDomainPCIAddressFlagsCompatible; virDomainPCIAddressGetNextSlot; -virDomainPCIAddressReleaseSlot; virDomainPCIAddressReserveAddr; virDomainPCIAddressReserveNextSlot; virDomainPCIAddressReserveSlot; @@ -110,7 +108,6 @@ virDomainPCIControllerModelToConnectType; virDomainVirtioSerialAddrAssign; virDomainVirtioSerialAddrAutoAssign; virDomainVirtioSerialAddrIsComplete; -virDomainVirtioSerialAddrRelease; virDomainVirtioSerialAddrReserve; virDomainVirtioSerialAddrSetAddControllers; virDomainVirtioSerialAddrSetCreate; -- 2.7.4 (Apple Git-66) -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list