The code can't fail so having error handling is pointless.
---
src/conf/domain_addr.c | 3 +--
src/conf/domain_addr.h | 4 ++--
src/qemu/qemu_domain_address.c | 7 ++-----
3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index 531fc6800..642268239 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -687,12 +687,11 @@ virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs,
}
-int
+void
virDomainPCIAddressReleaseAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr)
{
addrs->buses[addr->bus].slot[addr->slot].functions &= ~(1 <<
addr->function);
- return 0;
}
virDomainPCIAddressSetPtr
diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h
index 205e7cfe5..173101465 100644
--- a/src/conf/domain_addr.h
+++ b/src/conf/domain_addr.h
@@ -166,8 +166,8 @@ int virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs,
virDomainPCIConnectFlags flags)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-int virDomainPCIAddressReleaseAddr(virDomainPCIAddressSetPtr addrs,
- virPCIDeviceAddressPtr addr)
+void virDomainPCIAddressReleaseAddr(virDomainPCIAddressSetPtr addrs,
+ virPCIDeviceAddressPtr addr)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
void virDomainPCIAddressSetAllMulti(virDomainDefPtr def)
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index b94b73eaa..7f4ac0f45 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -2892,11 +2892,8 @@ qemuDomainReleaseDeviceAddress(virDomainObjPtr vm,
if (!devstr)
devstr = info->alias;
- if (virDeviceInfoPCIAddressPresent(info) &&
- virDomainPCIAddressReleaseAddr(priv->pciaddrs,
- &info->addr.pci) < 0)
- VIR_WARN("Unable to release PCI address on %s",
- NULLSTR(devstr));
+ if (virDeviceInfoPCIAddressPresent(info))
+ virDomainPCIAddressReleaseAddr(priv->pciaddrs, &info->addr.pci);
if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB &&
priv->usbaddrs &&
--
2.14.1