Re: [PATCH] nwfilter: Remove error report in virNWFilterDHCPSnoopEnd

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

 



On 04/11/2013 04:30 PM, Stefan Berger wrote:
> Remove error reporting when calling the virNWFilterDHCPSnoopEnd
> function with an interface for which no thread is snooping traffic.
>
> Document the usage of this function.
>
> Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxxxxxxxxxx>
>
> ---
>  src/nwfilter/nwfilter_dhcpsnoop.c |   15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> Index: libvirt/src/nwfilter/nwfilter_dhcpsnoop.c
> ===================================================================
> --- libvirt.orig/src/nwfilter/nwfilter_dhcpsnoop.c
> +++ libvirt/src/nwfilter/nwfilter_dhcpsnoop.c
> @@ -2117,6 +2117,16 @@ err_exit:
>      return -1;
>  }
>
> +/**
> + * End a DHCP snoop thread on the given interface or end all
> + * DHCP snoop threads.
> + *
> + * @ifname: Name of an interface or NULL to stop all snoop threads
> + *
> + * It is not an error to call this function with an interface name
> + * for which no thread is snooping traffic. In this case the call will
> + * be a no-op.
> + */
>  void
>  virNWFilterDHCPSnoopEnd(const char *ifname)
>  {
> @@ -2130,11 +2140,8 @@ virNWFilterDHCPSnoopEnd(const char *ifna
>      if (ifname) {
>          ifkey = (char *)virHashLookup(virNWFilterSnoopState.ifnameToKey,
>                                        ifname);
> -        if (!ifkey) {
> -            virReportError(VIR_ERR_INTERNAL_ERROR,
> -                           _("ifname \"%s\" not in key map"), ifname);
> +        if (!ifkey)
>              goto cleanup;
> -        }
>
> ignore_value(virHashRemoveEntry(virNWFilterSnoopState.ifnameToKey,
>                                          ifname));

ACK.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]