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 <mpriv...@redhat.com>
---
 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


Reply via email to