[libvirt] Query: Implementation of virNetworkGetDHCPLeases

Nehal J Wani nehaljw.kkd1 at gmail.com
Mon Jan 5 17:12:01 UTC 2015

In the method networkGetDHCPLeases inside
./src/network/bridge_driver.c  , we have:

    if (need_results && mac && !leases_ret) {
                       _("no lease with matching MAC address: %s"), mac);
        goto error;

Is this really required? In my opinion, since we are already filling
rv with nleases (which will be 0, in case no lease corresponding to
given mac is found), user will know that there is no result for his
query. Why to report error?

This results in:

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

Nehal J Wani

More information about the libvir-list mailing list