[libvirt] [PATCHv5 0/4] Introduce APIs to extract DHCP leases info
Nehal J Wani
nehaljw.kkd1 at gmail.com
Mon Dec 2 06:22:55 UTC 2013
On Tue, Nov 26, 2013 at 2:35 AM, Nehal J Wani <nehaljw.kkd1 at gmail.com> wrote:
>
> This API returns the leases information stored in the DHCP leases
> file of dnsmasq for a given virtual network. It contacts the
> bridge network driver, which parses a custom leases file created
> by libvirt.
>
> It supports two methods:
>
> 1. Return info for all network interfaces connected to a given
> virtual network
> 2. Return information for a particular network interface in a
> given virtual network by providing its MAC Address
>
> v5
> Created a helper file to generate custom leases for libvirt. Since dnsmasq
> doesn't provide the MAC Address in case of DHCPv6, the need for this file
> was proposed. The design of virNetworkDHCPLeases struct has been updated and
> the previous use of union has been removed. OOM errors have been taken care
> of in the remote driver and remote daemon.
> Discussion on struct design:
> https://www.redhat.com/archives/libvir-list/2013-October/msg00326.html
> Discussion on helper file:
> https://www.redhat.com/archives/libvir-list/2013-October/msg00989.html
>
> v4
> * Added support for DHCPv6, updated lease file parsing method
> Refer: https://www.redhat.com/archives/libvir-list/2013-September/msg01554.html
>
> v3
> * Mostly small nits, change in MACRO names, use of virSocketAddrGetIpPrefix to
> retrieve IP prefix from @dom XML.
> Refer: https://www.redhat.com/archives/libvir-list/2013-September/msg00832.html
>
> v2
> * Since DHCPv6 is supposed to be suported in future, virNetworkGetDHCPLeasesForMAC
> changed, prefix and virIPAddrType added in virNetworkDHCPLeases struct.
> Refer: https://www.redhat.com/archives/libvir-list/2013-September/msg00732.html
>
> v1
> * Refer: https://www.redhat.com/archives/libvir-list/2013-September/msg00620.html
>
> * The need for these APIs were result of a RFC was proposed on the list.
> Refer: http://www.redhat.com/archives/libvir-list/2013-July/msg01603.html
>
> Nehal J Wani (4):
> net-dhcp-leases: Implement the public APIs
> net-dhcp-leases: Implement the remote protocol
> net-dhcp-leases: Private implementation inside network driver
> net-dhcp-leases: Add virsh support
>
> daemon/remote.c | 176 ++++++++++++++++++++++++++++++
> include/libvirt/libvirt.h.in | 35 ++++++
> src/Makefile.am | 21 ++++
> src/driver.h | 13 +++
> src/libvirt.c | 197 ++++++++++++++++++++++++++++++++++
> src/libvirt_public.syms | 7 ++
> src/network/bridge_driver.c | 248 +++++++++++++++++++++++++++++++++++++++++++
> src/remote/remote_driver.c | 187 ++++++++++++++++++++++++++++++++
> src/remote/remote_protocol.x | 54 +++++++++-
> src/remote_protocol-structs | 38 +++++++
> src/rpc/gendispatch.pl | 1 +
> src/util/leaseshelper.c | 185 ++++++++++++++++++++++++++++++++
> tools/virsh-network.c | 118 ++++++++++++++++++++
> tools/virsh.pod | 6 ++
> 14 files changed, 1285 insertions(+), 1 deletion(-)
> create mode 100644 src/util/leaseshelper.c
>
> --
> 1.8.1.4
>
Ping. Once this is accepted, I'll integrate it with the
virDomainInterfaceAddresses API.
--
Nehal J Wani
More information about the libvir-list
mailing list