[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qemu-ga: Make guest-network-get-interfaces Linu
From: |
Michael Roth |
Subject: |
Re: [Qemu-devel] [PATCH] qemu-ga: Make guest-network-get-interfaces Linux only |
Date: |
Tue, 20 Mar 2012 11:10:46 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Tue, Mar 20, 2012 at 04:09:53PM +0100, Michal Privoznik wrote:
> Currently, the implementation of that command is full of
> Linux specific code. Before any brave man will step into
> and port it to other OSes, make this function Linux only.
>
> Signed-off-by: Michal Privoznik <address@hidden>
Which aspect is linux-specific? getifaddrs() and getnameinfo() seem to
be available on BSD and OpenSolaris, and we're already stubbed for w32.
Are you seeing breakage?
> ---
> qga/commands-posix.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index 7b2be2f..89dde92 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -729,6 +729,7 @@ void qmp_guest_suspend_hybrid(Error **err)
> guest_suspend("pm-suspend-hybrid", NULL, err);
> }
>
> +#if defined(__linux__)
> static GuestNetworkInterfaceList *
> guest_find_interface(GuestNetworkInterfaceList *head,
> const char *name)
> @@ -904,6 +905,16 @@ error:
> return NULL;
> }
>
> +#else /* defined(linux) */
> +
> +GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **err)
> +{
> + error_set(err, QERR_UNSUPPORTED);
> + return NULL;
> +}
> +
> +#endif /* defined(linux) */
> +
> /* register init/cleanup routines for stateful command groups */
> void ga_command_state_init(GAState *s, GACommandState *cs)
> {
> --
> 1.7.8.5
>
>