]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Fix compilation of legacy xen driver with Xen 4.2
authorJim Fehlig <jfehlig@suse.com>
Wed, 26 Sep 2012 21:20:35 +0000 (15:20 -0600)
committerJim Fehlig <jfehlig@suse.com>
Thu, 27 Sep 2012 16:27:33 +0000 (10:27 -0600)
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.

configure.ac
src/xen/block_stats.c
src/xen/xs_internal.c

index 38d94d40a84274e6e530951e5ee7ad356358592c..ae26de7ba9a72272ed4da3ad84fe29cc13336ee6 100644 (file)
@@ -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
index f3b756a96681ecdfdc7229fc8a73d6a828a09802..5ab1ce4acecf9f90528efcb1546fc6cba0ca4899 100644 (file)
 # 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"
index 12efa0c7bf16091382bf83578e6d5c7455f2f4db..a91d4094914741c1d539cf0728ddc6452182c189 100644 (file)
 #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"