From a4bac46c96f20902e1b3e13ac525bb936b2229a6 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 18 Oct 2017 16:12:53 +0200 Subject: [PATCH] qemu: address: Remove dead code when un-reserving PCI address 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 531fc68006..6422682391 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 205e7cfe51..1731014656 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 b94b73eaa2..7f4ac0f45a 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 && -- GitLab