networkGetDHCPLeases: Remove unnecessary error reporting

Lack of a lease (whether mac is given or not) is a normal expected
scenario, since we are already filling in rv with nleases (which is
okay as 0 if there is no lease).  There is no need to raise an error.

This fixes:

> virsh # net-dhcp-leases --mac 00:50:56:c0:00:01  default
> error: Failed to get leases info for default
> error: internal error: no lease with matching MAC address: 00:50:56:c0:00:01

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Nehal J Wani 2015-01-05 23:19:24 +05:30 committed by Eric Blake
parent 39449f70b9
commit 18ec863d19
1 changed files with 0 additions and 6 deletions

View File

@ -3654,12 +3654,6 @@ networkGetDHCPLeases(virNetworkPtr network,
VIR_FREE(lease);
}
if (need_results && mac && !leases_ret) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("no lease with matching MAC address: %s"), mac);
goto error;
}
if (leases_ret) {
/* NULL terminated array */
ignore_value(VIR_REALLOC_N(leases_ret, nleases + 1));