[libvirt] [RFC] The Quest for Domain-IP Mapping Continues...

Eric Blake eblake at redhat.com
Tue Dec 16 21:01:14 UTC 2014


On 12/14/2014 03:08 PM, Nehal J Wani wrote:

>> I think yuou should redo that patch series adding the DHCP lease support,
>> since that's the reason we didn't merge that code last time around.
> 
> The patch series is ready, but I have one question: From a developer's
> point of view, what should happen, when more than one flag is
> specified? (We can mention that the results can be ambiguous from
> user's point of view). Intuition says that the results should be
> combined. Options (virHashTable):
> (i) Should we use interface name as the key?
> (ii) Should we use the mac address as the key?
> Or should we just say that at one time, only one flag is supported?

What is the exact API you are proposing?

If you use flags (1, 2, 4, 8), then one possible semantic is that
specifying multiple flags at once allows the implementation to pick
which method it uses (or that it tries multiple methods until one
succeeds, but you don't know which one); if the caller cares about
knowing which one succeeds, then they must not mix flags.

The other alternative is to have a separate parameter from the flags,
where that value is the method; here, you would number your methods 0,
1, 2, 3, and have a _LAST member in the enum in case we later add other
methods.

But without seeing the proposed signature of the new API, I'm not sure
which way to lean.

-- 
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: 539 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141216/1ce246b0/attachment-0001.sig>


More information about the libvir-list mailing list