summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e0fdc19)
raw | patch | inline | side by side (parent: e0fdc19)
author | Florian Forster <octo@huhu.verplant.org> | |
Tue, 19 Aug 2008 07:24:33 +0000 (09:24 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Tue, 19 Aug 2008 07:24:33 +0000 (09:24 +0200) |
The used `kvm_getswapinfo' is apparently an extension not all versions of the
kvm library support.
kvm library support.
configure.in | patch | blob | history | |
src/Makefile.am | patch | blob | history | |
src/swap.c | patch | blob | history |
diff --git a/configure.in b/configure.in
index e6e2531d1e1b6b63a3986707b4a24cb7b04b615d..e8fe287bfd23d94370fc8f03b7209a3ea285a283 100644 (file)
--- a/configure.in
+++ b/configure.in
AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
fi
-AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_libkvm="yes"], [with_libkvm="no"])
-if test "x$with_libkvm" = "xyes"
+AC_CHECK_LIB(kvm, kvm_getswapinfo, [with_kvm_getswapinfo="yes"], [with_kvm_getswapinfo="no"])
+if test "x$with_kvm_getswapinfo" = "xyes"
then
- AC_DEFINE(HAVE_LIBKVM, 1, [Define to 1 if you have the 'kvm' library (-lkvm)])
+ AC_DEFINE(HAVE_LIBKVM_GETSWAPINFO, 1,
+ [Define to 1 if you have the 'kvm' library with the 'kvm_getswapinfo' symbol (-lkvm)])
fi
-AM_CONDITIONAL(BUILD_WITH_LIBKVM, test "x$with_libkvm" = "xyes")
+AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "xyes")
with_sensors_cflags=""
with_sensors_ldflags=""
diff --git a/src/Makefile.am b/src/Makefile.am
index 02b85fcd1d7f438c718826f0c1957e2af0a5dc81..7dad34011f3214cc32ab6538d7d9827064a04576 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
if BUILD_WITH_LIBDEVINFO
swap_la_LIBADD += -ldevinfo
endif
-if BUILD_WITH_LIBKVM
+if BUILD_WITH_LIBKVM_GETSWAPINFO
swap_la_LIBADD += -lkvm
endif
if BUILD_WITH_LIBSTATGRAB
diff --git a/src/swap.c b/src/swap.c
index 4d1f24de73ae40bf79a07621e6bfb945521669a3..7fa72dc92458ae6d2993cd897eaeb1110a599990 100644 (file)
--- a/src/swap.c
+++ b/src/swap.c
/* No global variables */
/* #endif defined(VM_SWAPUSAGE) */
-#elif HAVE_LIBKVM
+#elif HAVE_LIBKVM_GETSWAPINFO
static kvm_t *kvm_obj = NULL;
int kvm_pagesize;
-/* #endif HAVE_LIBKVM */
+/* #endif HAVE_LIBKVM_GETSWAPINFO */
#elif HAVE_LIBSTATGRAB
/* No global variables */
/* No init stuff */
/* #endif defined(VM_SWAPUSAGE) */
-#elif HAVE_LIBKVM
+#elif HAVE_LIBKVM_GETSWAPINFO
if (kvm_obj != NULL)
{
kvm_close (kvm_obj);
ERROR ("swap plugin: kvm_open failed.");
return (-1);
}
-/* #endif HAVE_LIBKVM */
+/* #endif HAVE_LIBKVM_GETSWAPINFO */
#elif HAVE_LIBSTATGRAB
/* No init stuff */
swap_submit ("free", sw_usage.xsu_avail);
/* #endif VM_SWAPUSAGE */
-#elif HAVE_LIBKVM
+#elif HAVE_LIBKVM_GETSWAPINFO
struct kvm_swap data_s;
int status;
swap_submit ("used", used);
swap_submit ("free", free);
-/* #endif HAVE_LIBKVM */
+/* #endif HAVE_LIBKVM_GETSWAPINFO */
#elif HAVE_LIBSTATGRAB
sg_swap_stats *swap;