]> xenbits.xensource.com Git - libvirt.git/commitdiff
networkGetDHCPLeases: Remove unnecessary error reporting
authorNehal J Wani <nehaljw.kkd1@gmail.com>
Mon, 5 Jan 2015 17:49:24 +0000 (23:19 +0530)
committerEric Blake <eblake@redhat.com>
Mon, 5 Jan 2015 23:58:18 +0000 (16:58 -0700)
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>
src/network/bridge_driver.c

index 6055c712a12c38fc3d96f2a3c79b53324727a9ec..fca60f112c66c87825f861b2707aa3377b80e342 100644 (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));