[libvirt] [for 1.2.6] Redundancy of virNetworkGetDHCPLeases and virNetworkGetDHCPLeasesForMAC

Eric Blake eblake at redhat.com
Thu Jun 26 15:49:20 UTC 2014


On 06/26/2014 07:36 AM, Daniel P. Berrange wrote:

>>> Both of those return a list of lease structures and the only difference
>>> is the presence of the @mac argument.
>>>
>>> We could unify those two APIs into one with the following signature:
>>>
>>> int
>>> virNetworkGetDHCPLeases(virNetworkPtr network,
>>>                         const char *mac,
>>>                         virNetworkDHCPLeasePtr **leases,
>>>                         unsigned int flags)
>>>
>>> And tweak the semantics of @mac where when the user passes NULL we'd
>>> return the complete unfiltered list.

I'm in favor of this simplification as well.

> Of course what I completely missed was that even in the ForMAC
> case, we have to return a dynamic list of leases, because you
> can have both IPv4 and IPv6 leases for the same MAC. This
> basically kills the main compelling reason to have 2 separate
> APIs.

I remember the earlier debate, and think I kind of missed that point at
the time, as well.

> 
> So in retrospect I was wrong, and I agree with Peter that we
> should kill the ForMAC API and just add an (optional) macaddr
> parameter to the first API. Of course we can only decided to
> do this now before we release.

Yes, now is the time to make the fix, before RC-2 is spun (so we still
have some test time), and before it is baked into the 1.2.6 release.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140626/36defb4d/attachment-0001.sig>


More information about the libvir-list mailing list