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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]