nwfilter: Remove error report in virNWFilterDHCPSnoopEnd

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@linux.vnet.ibm.com>
This commit is contained in:
Stefan Berger 2013-05-24 08:01:03 -04:00 committed by Stefan Berger
parent 5af3ce8277
commit b9c4bd0c07

View File

@ -2118,6 +2118,16 @@ err_exit:
return -1; 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 void
virNWFilterDHCPSnoopEnd(const char *ifname) virNWFilterDHCPSnoopEnd(const char *ifname)
{ {
@ -2131,11 +2141,8 @@ virNWFilterDHCPSnoopEnd(const char *ifname)
if (ifname) { if (ifname) {
ifkey = (char *)virHashLookup(virNWFilterSnoopState.ifnameToKey, ifkey = (char *)virHashLookup(virNWFilterSnoopState.ifnameToKey,
ifname); ifname);
if (!ifkey) { if (!ifkey)
virReportError(VIR_ERR_INTERNAL_ERROR,
_("ifname \"%s\" not in key map"), ifname);
goto cleanup; goto cleanup;
}
ignore_value(virHashRemoveEntry(virNWFilterSnoopState.ifnameToKey, ignore_value(virHashRemoveEntry(virNWFilterSnoopState.ifnameToKey,
ifname)); ifname));