[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 2/2] qga: win32 implementation of qmp_guest_n

From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 2/2] qga: win32 implementation of qmp_guest_network_get_interfaces
Date: Thu, 28 May 2015 16:56:15 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 05/28/2015 12:41 PM, Kirk Allan wrote:
> By default, IP addresses and prefixes will be derived from information
> obtained by various calls and structures.  IPv4 prefixes can be found
> by matching the address to those returned by GetAdaptersInfo.  IPv6
> prefixes can not be matched this way due to the unpredictable order of
> entries.
> In Windows Visa/2008 guests and newer, it is possible to use inet_ntop()


> and  OnLinkPrefixLength to get  IPv4 and IPv6 addresses and prefixes.

Why the  double  spacing?

> Setting –extra-cflags in the build configuration to

Again, Unicode mdash looks odd.

> ”- D_WIN32_WINNT-0x600 -DWINVER=0x600” or greater enables this functionality
> for those guests.  Setting –ectra-cflags is not required and if not used,


> the default approach will be taken.
> Signed-off-by: Kirk Allan <address@hidden>
> ---
>  qga/commands-win32.c | 292 
> ++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 290 insertions(+), 2 deletions(-)

> +
> +static char *guest_inet_ntop(int af, void *cp, char *buf, size_t len)
> +{
> +#if (_WIN32_WINNT >= 0x0600) && defined(ARCH_x86_64)
> +    /* If built for 64 bit Windows Vista/2008 or newer, inet_ntop() is
> +     * available for use.  Otherwise, do our best to derive it.
> +     */
> +    return (char *)InetNtop(af, cp, buf, len);
> +#else

Are you sure glib doesn't provide some sort of inet_ntop wrapper that
you could crib, instead of rolling your own?  And if you must roll your
own, do it as a separate patch from the rest of this work, possibly by
copying from glibc or other existing implementation (with proper credits
to the upstream source), rather than writing it from scratch.

> +    u_char *p;

u_char is not a standard typedef; uint8_t is more common.

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]