aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Fehlig <jfehlig@suse.com>2012-09-26 15:20:35 -0600
committerDoug Goldstein <cardoe@cardoe.com>2012-10-05 13:26:16 -0500
commita3cca05e6064c4361b16cb9bf8b536b045b9cb6f (patch)
tree94ccd2b5ac7034e740751827836a13fddd7a09be
parentbuild: default selinuxfs mount point to /sys/fs/selinux (diff)
downloadlibvirt-a3cca05e6064c4361b16cb9bf8b536b045b9cb6f.tar.gz
libvirt-a3cca05e6064c4361b16cb9bf8b536b045b9cb6f.tar.bz2
libvirt-a3cca05e6064c4361b16cb9bf8b536b045b9cb6f.zip
Fix compilation of legacy xen driver with Xen 4.2
In Xen 4.2, xs.h is deprecated in favor of xenstore.h. xs.h now contains #warning xs.h is deprecated use xenstore.h instead #include <xenstore.h> which fails compilation when warnings are treated as errors. Introduce a configure-time check for xenstore.h and if found, use it instead of xs.h.
-rw-r--r--configure.ac2
-rw-r--r--src/xen/block_stats.c6
-rw-r--r--src/xen/xs_internal.c6
3 files changed, 12 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 427212686..6237a68ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -768,6 +768,8 @@ if test "$with_xen" != "no" ; then
fi
if test "$with_xen" != "no" ; then
+ dnl In Xen 4.2, xs.h is deprecated in favor of xenstore.h.
+ AC_CHECK_HEADERS([xenstore.h])
AC_CHECK_HEADERS([xen/xen.h xen/version.h xen/dom0_ops.h],,[
if test "$with_xen" = "yes"; then
fail=1
diff --git a/src/xen/block_stats.c b/src/xen/block_stats.c
index f3b756a96..5ab1ce4ac 100644
--- a/src/xen/block_stats.c
+++ b/src/xen/block_stats.c
@@ -32,7 +32,11 @@
# include <unistd.h>
# include <regex.h>
-# include <xs.h>
+# if HAVE_XENSTORE_H
+# include <xenstore.h>
+# else
+# include <xs.h>
+# endif
# include "virterror_internal.h"
# include "datatypes.h"
diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c
index 12efa0c7b..a91d40949 100644
--- a/src/xen/xs_internal.c
+++ b/src/xen/xs_internal.c
@@ -35,7 +35,11 @@
#include <xen/dom0_ops.h>
#include <xen/version.h>
-#include <xs.h>
+#if HAVE_XENSTORE_H
+# include <xenstore.h>
+#else
+# include <xs.h>
+#endif
#include "virterror_internal.h"
#include "datatypes.h"