[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 1/2] qemu: Remove dead code



On Fri, May 20, 2016 at 10:21:47AM -0400, John Ferlan wrote:
> Since commit id '20a0fa8e' removed the QEMU_CAPS_DEVICE, Coverity notes
> that it's no longer possible to have 'addrs' be NULL when checking for
> a live domain since qemuDomainPCIAddressSetCreate would have jumped to
> cleanup if addrs was NULL.
> 
> Signed-off-by: John Ferlan <jferlan redhat com>
> ---
>  src/qemu/qemu_domain_address.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
> index 9d09b3a..0a92b0e 100644
> --- a/src/qemu/qemu_domain_address.c
> +++ b/src/qemu/qemu_domain_address.c
> @@ -1618,15 +1618,11 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
>  
>      if (obj && obj->privateData) {
>          priv = obj->privateData;
> -        if (addrs) {
> -            /* if this is the live domain object, we persist the PCI addresses*/
> -            virDomainPCIAddressSetFree(priv->pciaddrs);
> -            priv->persistentAddrs = 1;
> -            priv->pciaddrs = addrs;
> -            addrs = NULL;
> -        } else {
> -            priv->persistentAddrs = 0;
> -        }
> +        /* if this is the live domain object, we persist the PCI addresses*/
> +        virDomainPCIAddressSetFree(priv->pciaddrs);
> +        priv->persistentAddrs = 1;

The whole persistentAddrs variable has not been used in years and can be
dropped:
https://www.redhat.com/archives/libvir-list/2016-May/msg01575.html

Jan

> +        priv->pciaddrs = addrs;
> +        addrs = NULL;
>      }
>  
>      ret = 0;
> -- 
> 2.5.5
> 
> --
> libvir-list mailing list
> libvir-list redhat com
> https://www.redhat.com/mailman/listinfo/libvir-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]