<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 26, 2015 at 12:08 AM, Nehal J Wani <span dir="ltr"><<a href="mailto:nehaljw.kkd1@gmail.com" target="_blank">nehaljw.kkd1@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This feature has been requested for a very long time. Since qemu guest<br>
agent and leaseshelper give us reliable results, now the wait is over.<br>
<br>
The RFC was first proposed by Michal Privoznik:<br>
     <a href="http://www.redhat.com/archives/libvir-list/2012-February/msg00437.html" target="_blank">http://www.redhat.com/archives/libvir-list/2012-February/msg00437.html</a><br>
A patch was submitted, using structs:<br>
     <a href="https://www.redhat.com/archives/libvir-list/2012-June/msg00220.html" target="_blank">https://www.redhat.com/archives/libvir-list/2012-June/msg00220.html</a><br>
Another patch was submitted, using XML:<br>
     <a href="https://www.redhat.com/archives/libvir-list/2012-June/msg00904.html" target="_blank">https://www.redhat.com/archives/libvir-list/2012-June/msg00904.html</a><br>
<br>
Neither of the patches were accepted, probably due to lack of extensibility<br>
and usability. Hence, we thought of using virTypedParameters for reporting<br>
list of interfaces along with their MAC address and IP addresses. The RFC<br>
can be found here:<br>
     <a href="https://www.redhat.com/archives/libvir-list/2013-July/msg00084.html" target="_blank">https://www.redhat.com/archives/libvir-list/2013-July/msg00084.html</a><br>
<br>
The idea of extensibility was rejected and rendered out of scope of<br>
libvirt. Hence, we were back to structs.<br>
<br>
This API is called virDomainInterfaceAddresses which returns a dynamically<br>
allocated array of virDomainInterface struct. The great disadvantage is<br>
once this gets released, it's written in stone and we cannot change<br>
or add an item into it.<br>
<br>
The virsh CLI supports two methods:<br>
<br>
* Return information (list of all associated interfaces with MAC address<br>
     and IP addresses) of all of the domain interfaces by default (if<br>
     no interface name is provided)<br>
<br>
* Return information for the specified interface (if an interface name<br>
     is provided)<br>
<br>
v8:<br>
* qemuDomainInterfaceAddresses: redo logic related to flags<br>
* Make sure that NIC(s) on guest is/are using libvirt virtual network<br>
  before querying leaseshelper<br>
* domifaddr: change --network option from VSH_OT_DATA to VSH_OT_STRING<br>
<br>
v7:<br>
* Enable support for DHCP lease file parsing method<br>
* <a href="http://www.redhat.com/archives/libvir-list/2014-December/msg00866.html" target="_blank">http://www.redhat.com/archives/libvir-list/2014-December/msg00866.html</a><br>
<br>
v6:<br>
* Inclusion of flags, readonly check for guest agent connection<br>
* Correction of memory leaks, other small nits.<br>
* <a href="https://www.redhat.com/archives/libvir-list/2013-September/msg00350.html" target="_blank">https://www.redhat.com/archives/libvir-list/2013-September/msg00350.html</a><br>
<br>
v5:<br>
* s/virDomainInterfacesAddresses/virDomainInterfaceAddresses.<br>
* Case for IP aliasing handled using virHashTable.<br>
* New test cases added, involving multiple and 0 IP addresse(s)<br>
  per interface.<br>
* IP prefix changed from int to unsigned int.<br>
* Changes to practice libvirt habits.<br>
* <a href="https://www.redhat.com/archives/libvir-list/2013-September/msg00003.html" target="_blank">https://www.redhat.com/archives/libvir-list/2013-September/msg00003.html</a><br>
<br>
v4:<br>
* Various style nits, indentation errors, memory leaks fixed.<br>
* <a href="https://www.redhat.com/archives/libvir-list/2013-August/msg01265.html" target="_blank">https://www.redhat.com/archives/libvir-list/2013-August/msg01265.html</a><br>
<br>
v3:<br>
* Upper bounds to number of interfaces and addresses per interface<br>
  introduced.<br>
* Change from array of structs to array of pointers<br>
* ifaces_count moved from function argument to return value<br>
* Changes in variable names<br>
* Test cases added for qemuAgentGetInterfaces.<br>
* <a href="https://www.redhat.com/archives/libvir-list/2013-August/msg01215.html" target="_blank">https://www.redhat.com/archives/libvir-list/2013-August/msg01215.html</a><br>
<br>
v2:<br>
* Logical errors, memory leaks and few other errors fixed.<br>
* <a href="https://www.redhat.com/archives/libvir-list/2013-August/msg00631.html" target="_blank">https://www.redhat.com/archives/libvir-list/2013-August/msg00631.html</a><br>
<br>
v1:<br>
* <a href="http://www.redhat.com/archives/libvir-list/2013-July/msg01553.html" target="_blank">http://www.redhat.com/archives/libvir-list/2013-July/msg01553.html</a><br>
<br>
<br>
Nehal J Wani (4):<br>
  domifaddr: Implement the public APIs<br>
  domifaddr: Implement the remote protocol<br>
  domifaddr: Implement the API for qemu<br>
  domifaddr: Add virsh support<br>
<br>
 daemon/remote.c                  | 134 ++++++++++++++++++++++++++<br>
 include/libvirt/libvirt-domain.h |  27 ++++++<br>
 src/driver-hypervisor.h          |   5 +<br>
 src/libvirt-domain.c             | 129 +++++++++++++++++++++++++<br>
 src/libvirt_public.syms          |   6 ++<br>
 src/qemu/qemu_agent.c            | 202 +++++++++++++++++++++++++++++++++++++++<br>
 src/qemu/qemu_agent.h            |   4 +<br>
 src/qemu/qemu_driver.c           | 173 +++++++++++++++++++++++++++++++++<br>
 src/remote/remote_driver.c       | 100 +++++++++++++++++++<br>
 src/remote/remote_protocol.x     |  36 ++++++-<br>
 src/remote_protocol-structs      |  24 +++++<br>
 tests/qemuagenttest.c            | 188 ++++++++++++++++++++++++++++++++++++<br>
 tools/virsh-domain-monitor.c     | 141 +++++++++++++++++++++++++++<br>
 tools/virsh.pod                  |  16 ++++<br>
 14 files changed, 1184 insertions(+), 1 deletion(-)<br>
<span class=""><font color="#888888"><br>
--<br>
2.1.0<br>
<br>
</font></span></blockquote></div><br>Ping! :)<br clear="all"><br>-- <br><div class="gmail_signature">Nehal J Wani<br></div>
</div></div>