[libvirt] [PATCHv7 3/4] domifaddr: Implement the API for qemu

Daniel P. Berrange berrange at redhat.com
Tue Jan 13 14:54:24 UTC 2015


On Mon, Jan 05, 2015 at 10:54:35PM +0530, Nehal J Wani wrote:
> 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 at gmail.com>
> ---
>  These are very minor changes, and rest of the patches in the series haven't
>  been reviewed yet. Hence sending fix in the same version. :)
>  src/qemu/qemu_agent.c  | 202 +++++++++++++++++++++++++++++++++++++++++++++++++
>  src/qemu/qemu_agent.h  |   4 +
>  src/qemu/qemu_driver.c | 159 ++++++++++++++++++++++++++++++++++++++
>  tests/qemuagenttest.c  | 188 +++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 553 insertions(+)

ACK

Regards,
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 :|




More information about the libvir-list mailing list