Re: [PATCH 1/4] net-dhcp-leases: Implement the public APIs

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

 



On Wed, Sep 11, 2013 at 02:18:04PM -0400, Laine Stump wrote:
> On 09/11/2013 01:14 PM, Daniel P. Berrange wrote:
> > On Wed, Sep 11, 2013 at 10:35:04PM +0530, Nehal J Wani wrote:
> >> On Wed, Sep 11, 2013 at 9:25 PM, Daniel P. Berrange <berrange@xxxxxxxxxx> wrote:
> >>> On Wed, Sep 11, 2013 at 09:00:09PM +0530, Nehal J Wani wrote:
> >>>> diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
> >>>> index a47e33c..3885baf 100644
> >>>> --- a/include/libvirt/libvirt.h.in
> >>>> +++ b/include/libvirt/libvirt.h.in
> >>>> @@ -2800,6 +2800,28 @@ int                     virConnectNumOfDefinedInterfaces (virConnectPtr conn);
> >>>>  int                     virConnectListDefinedInterfaces  (virConnectPtr conn,
> >>>>                                                            char **const names,
> >>>>                                                            int maxnames);
> >>>> +
> >>>> +typedef struct _virNetworkDHCPLeases virNetworkDHCPLeases;
> >>>> +typedef virNetworkDHCPLeases *virNetworkDHCPLeasesPtr;
> >>>> +struct _virNetworkDHCPLeases {
> >>>> +    long long expirytime;
> >>>> +    char *mac;
> >>>> +    char *ipaddr;
> >>>> +    char *hostname;
> >>>> +    char *clientid;
> >>>> +};
> >>> This is missing
> >>>
> >>>     int type;                /* virIPAddrType */
> >>>
> >>> since it can be IPv4 or IPv6 in general.
> >>>
> >>> Also we have no 'prefix' field here. Although the 'prefix' is present in
> >>> the network XML config, I think it would be useful to include it here
> >>> too, for parity with the virDomainInterfaceIPAddress struct
> >>>
> >> The virNetworkDHCPLeases struct was made according to the lease
> >> parameters returned by dnsmasq. Are you suggesting that libvirt might
> >> shift to some other DHCP server in future? Also, in case the DHCP server
> >> doesn't return the IP address type and/or prefix, in that case, should these
> >> values be NULL, when returned to the user?
> > When doing API design we must *not* make assumptions about the current
> > impl that libvirt happens to have. We must always think of possible
> > future changes.
> 
> 
> I may be mistaken, but I thought I remembered someone talking about an
> alternate implementation using ISC dhcpd instead of dnsmasq.
> 
> A concrete example of this is that in earlier versions of libvirt (and
> still for earlier versions of dnsmasq even with current libvirt) we
> use(d) radvd for ipv6 autoconf, but in newer libvirt with newer versions
> of dnsmasq, we use the autoconf support that is now built into dnsmasq.
> The libvirt network configuration remains the same; This is possible
> because the configuration is agnostic to the underlying implementation.
> 
> 
> >   The DHCP server doesn't need to return prefix - we have
> > that available in virNetworkDefPtr. As for IP address type, we can currently
> > hardcode that as IPV4, since we know dnsmasq only uses that. 
> 
> commit 2d5cd1d724084d9975b2514fb31776627acbe997
> Author: Gene Czarcinski <gene@xxxxxxxxx>
> Date:   Thu Dec 6 12:20:38 2012 -0500
> 
>     network: add support for DHCPv6
> 
> 
> I haven't used it, but as far as I know it works (if it doesn't then
> Gene is in a heap of trouble :-)

Ah, then we need to support multiple addresses per MAC already
then

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
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]