xenstat: add a dummy FreeBSD implementation
authorRoger Pau Monne <roger.pau@citrix.com>
Wed, 16 Apr 2014 14:13:29 +0000 (16:13 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 2 May 2014 12:34:34 +0000 (13:34 +0100)
Add an empty FreeBSD implementation so xenstat can compile on FreeBSD.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/xenstat/libxenstat/Makefile
tools/xenstat/libxenstat/src/xenstat_freebsd.c [new file with mode: 0644]

index 21aad8923eed94d94249a4ee6eb098953b2593fe..15dc22dc6133b7efffe565ff356bc9e50cf10f6a 100644 (file)
@@ -32,6 +32,7 @@ OBJECTS-y=src/xenstat.o
 OBJECTS-$(CONFIG_Linux) += src/xenstat_linux.o
 OBJECTS-$(CONFIG_SunOS) += src/xenstat_solaris.o
 OBJECTS-$(CONFIG_NetBSD) += src/xenstat_netbsd.o
+OBJECTS-$(CONFIG_FreeBSD) += src/xenstat_freebsd.o
 SONAME_FLAGS=-Wl,$(SONAME_LDFLAG) -Wl,libxenstat.so.$(MAJOR)
 
 WARN_FLAGS=-Wall -Werror
diff --git a/tools/xenstat/libxenstat/src/xenstat_freebsd.c b/tools/xenstat/libxenstat/src/xenstat_freebsd.c
new file mode 100644 (file)
index 0000000..0c488df
--- /dev/null
@@ -0,0 +1,47 @@
+/* libxenstat: statistics-collection library for Xen
+ * Copyright (C) International Business Machines Corp., 2005
+ * Authors: Josh Triplett <josht@us.ibm.com>
+ *          Judy Fischbach <jfisch@us.ibm.com>
+ *          David Hendricks <dhendrix@us.ibm.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include "xenstat_priv.h"
+
+/* Collect information about networks */
+int xenstat_collect_networks(xenstat_node * node)
+{
+
+       return 1;
+}
+
+/* Free network information in handle */
+void xenstat_uninit_networks(xenstat_handle * handle)
+{
+}
+
+/* Collect information about VBDs */
+int xenstat_collect_vbds(xenstat_node * node)
+{
+
+       return 1;
+}
+
+/* Free VBD information in handle */
+void xenstat_uninit_vbds(xenstat_handle * handle)
+{
+}