]> xenbits.xensource.com Git - libvirt.git/commit
domifaddr: Implement the API for qemu
authorNehal J Wani <nehaljw.kkd1@gmail.com>
Sun, 25 Jan 2015 18:38:48 +0000 (00:08 +0530)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 17 Mar 2015 15:15:38 +0000 (15:15 +0000)
commit0977b8aa071de550e1a013d35e2c72615e65d520
treef18db10840aebcefcdaebab30462f80cc9b06999
parent71546d1798fc6ae4a55acf1b63f33d37ec71ba3e
domifaddr: Implement the API for qemu

By querying the qemu guest agent with the QMP command
"guest-network-get-interfaces" and converting the received JSON
output to structured objects.

Although "ifconfig" is deprecated, IP aliases created by "ifconfig"
are supported by this API. The legacy syntax of an IP alias is:
"<ifname>:<alias-name>". Since we want all aliases to be clubbed
under parent interface, simply stripping ":<alias-name>" suffices.
Note that IP aliases formed by "ip" aren't visible to "ifconfig",
and aliases created by "ip" do not have any specific name. But
we are lucky, as qemu guest agent detects aliases created by both.

src/qemu/qemu_agent.h:
  * Define qemuAgentGetInterfaces

src/qemu/qemu_agent.c:
  * Implement qemuAgentGetInterface

src/qemu/qemu_driver.c:
  * New function qemuGetDHCPInterfaces
  * New function qemuDomainInterfaceAddresses

src/remote_protocol-sructs:
  * Define new structs

tests/qemuagenttest.c:
  * Add new test: testQemuAgentGetInterfaces
    Test cases for IP aliases, 0 or multiple ipv4/ipv6 address(es)

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
src/qemu/qemu_agent.c
src/qemu/qemu_agent.h
src/qemu/qemu_driver.c
tests/qemuagenttest.c