From: Michal Privoznik <mprivozn@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] qemu-ga: Add guest-network-info command
Date: Fri, 17 Feb 2012 13:04:53 +0100 [thread overview]
Message-ID: <4F3E4265.6070700@redhat.com> (raw)
In-Reply-To: <bcbadcf3c15dd1a4c2849d8d322cc1373759e1a9.1329478241.git.mprivozn@redhat.com>
On 17.02.2012 12:35, Michal Privoznik wrote:
> This command returns an array of:
>
> [ifname, ipaddr, ipaddr_family, prefix, hwaddr]
>
> for each interface in the system that has an IP address.
> Currently, only IPv4 and IPv6 are supported.
>
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
> diff to v1:
> -move from guest-getip to guest-network-info
> -replace black boxed algorithm for population count
> -several coding styles improvements
>
> qapi-schema-guest.json | 29 ++++++++
> qga/guest-agent-commands.c | 163 ++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 192 insertions(+), 0 deletions(-)
>
> + } else if (family == AF_INET6) {
> + /* interface with IPv6 address */
> + tmp_addr_ptr = &((struct sockaddr_in6 *)ifa->ifa_addr)->sin6_addr;
> + inet_ntop(AF_INET6, tmp_addr_ptr, addr6, sizeof(addr6));
> +
> + info = g_malloc0(sizeof(*info));
> + info->value = g_malloc0(sizeof(*info->value));
> + info->value->iface.name = g_strdup(ifa->ifa_name);
> + info->value->iface.ipaddr = g_strdup(addr6);
In fact, I've forgotten to add:
info->value->iface.ipaddrtype = GUEST_IP_ADDR_TYPE_IPV6;
So I guess I'll send v3.
prev parent reply other threads:[~2012-02-17 12:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-17 11:35 [Qemu-devel] [PATCH v2] qemu-ga: Add guest-network-info command Michal Privoznik
2012-02-17 12:04 ` Michal Privoznik [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F3E4265.6070700@redhat.com \
--to=mprivozn@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.