mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
39449f70b9
commit
18ec863d19
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue