Skip to contentSkip to conversation

Move xenstore and libxc public headers to include subdir

PATCH Superseded Stefano Stabellini 3 participants 9 messages Jul 11, 2014 – Jul 14, 2014

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Move xenstore and libxc public headers to include subdir

Also moves xc_dom.h to include as it is used often by other xen tools. Use the new include subdirectories to build Xen tools and qemu-xen.

Add the old libxc include path to the programs that need it to build, on a case by case basis and commeting that they shouldn't require internal libxc headers to build.

---

Changes in v2:

- squash the patches together to retain bisectibility;
- use the new include subdirectories to build xen tools, do not add the old libxc include path to CFLAGS_libxenctrl and the old xenstore include path to CFLAGS_libxenstore.

---
 tools/Makefile                               |    6 +++---
 tools/Rules.mk                               |    6 +++---
 tools/blktap2/drivers/Makefile               |    2 ++
 tools/libxc/Makefile                         |    6 +++---
 tools/libxc/{ => include}/xc_dom.h           |    0
 tools/libxc/{ => include}/xenctrl.h          |    0
 tools/libxc/{ => include}/xenctrlosdep.h     |    0
 tools/libxc/{ => include}/xenguest.h         |    0
 tools/libxc/{ => include}/xentoollog.h       |    0
 tools/misc/Makefile                          |    2 ++
 tools/python/setup.py                        |    4 ++--
 tools/xcutils/Makefile                       |    3 ++-
 tools/xenpaging/Makefile                     |    3 ++-
 tools/xenstore/Makefile                      |    9 +++++----
 tools/xenstore/{ => include}/compat/xs.h     |    0
 tools/xenstore/{ => include}/compat/xs_lib.h |    0
 tools/xenstore/{ => include}/xenstore.h      |    0
 tools/xenstore/{ => include}/xenstore_lib.h  |    0
 18 files changed, 24 insertions(+), 17 deletions(-)
 rename tools/libxc/{ => include}/xc_dom.h (100%)
 rename tools/libxc/{ => include}/xenctrl.h (100%)
 rename tools/libxc/{ => include}/xenctrlosdep.h (100%)
 rename tools/libxc/{ => include}/xenguest.h (100%)
 rename tools/libxc/{ => include}/xentoollog.h (100%)
 rename tools/xenstore/{ => include}/compat/xs.h (100%)
 rename tools/xenstore/{ => include}/compat/xs_lib.h (100%)
 rename tools/xenstore/{ => include}/xenstore.h (100%)
 rename tools/xenstore/{ => include}/xenstore_lib.h (100%)
tools/Makefile +3 -3
index f4aa200..5f32dcc 100644
@@ -188,9 +188,9 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--includedir=$(PREFIX)/lib/xen/include \
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
-		-I$(XEN_ROOT)/tools/libxc \
-		-I$(XEN_ROOT)/tools/xenstore \
-		-I$(XEN_ROOT)/tools/xenstore/compat \
+		-I$(XEN_ROOT)/tools/libxc/include \
+		-I$(XEN_ROOT)/tools/xenstore/include \
+		-I$(XEN_ROOT)/tools/xenstore/compat/include \
 		$(EXTRA_CFLAGS_QEMU_XEN)" \
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore \
tools/Rules.mk +3 -3
index 13d8fc1..53f51a8 100644
@@ -19,15 +19,15 @@ XEN_LIBVCHAN       = $(XEN_ROOT)/tools/libvchan
 
 CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 
-CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
+CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl.so
 SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
 
-CFLAGS_libxenguest = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
+CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenguest = $(XEN_LIBXC)/libxenguest.so
 SHLIB_libxenguest  = -Wl,-rpath-link=L$(XEN_LIBXC)
 
-CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_xeninclude)
+CFLAGS_libxenstore = -I$(XEN_XENSTORE)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenstore = $(XEN_XENSTORE)/libxenstore.so
 SHLIB_libxenstore  = -Wl,-rpath-link=$(XEN_XENSTORE)
 
tools/blktap2/drivers/Makefile +2 -0
index 1129ca1..7df9bc4 100644
@@ -16,6 +16,8 @@ CFLAGS    += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
 CFLAGS    += $(CFLAGS_libxenctrl)
 CFLAGS    += -D_GNU_SOURCE
 CFLAGS    += -DUSE_NFS_LOCKS
+# drivers/block-log.c incorrectly uses libxc internals
+CFLAGS    += -I$(XEN_ROOT)/tools/libxc
 
 ifeq ($(CONFIG_X86_64),y)
 CFLAGS            += -fPIC
tools/libxc/Makefile +3 -3
index f77677c..da59e10 100644
@@ -89,7 +89,7 @@ OSDEP_SRCS-y                 += xenctrl_osdep_ENOSYS.c
 -include $(XEN_TARGET_ARCH)/Makefile
 
 CFLAGS   += -Werror -Wmissing-prototypes
-CFLAGS   += -I. $(CFLAGS_xeninclude)
+CFLAGS   += -I. -I./include $(CFLAGS_xeninclude)
 
 # Needed for posix_fadvise64() in xc_linux.c
 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
@@ -140,12 +140,12 @@ install: build
 	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(LIBDIR)
 	ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so.$(MAJOR)
 	ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so
-	$(INSTALL_DATA) xenctrl.h xenctrlosdep.h xentoollog.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h include/xentoollog.h $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
 	$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(LIBDIR)
 	ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenguest.so.$(MAJOR)
 	ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenguest.so
-	$(INSTALL_DATA) xenguest.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/xenguest.h $(DESTDIR)$(INCLUDEDIR)
 
 .PHONY: TAGS
 TAGS:
tools/libxc/include/xc_dom.h renamed from tools/libxc/xc_dom.h +0 -0
similarity index 100%
rename from tools/libxc/xc_dom.h
rename to tools/libxc/include/xc_dom.h
tools/libxc/include/xenctrl.h renamed from tools/libxc/xenctrl.h +0 -0
similarity index 100%
rename from tools/libxc/xenctrl.h
rename to tools/libxc/include/xenctrl.h
tools/libxc/include/xenctrlosdep.h renamed from tools/libxc/xenctrlosdep.h +0 -0
similarity index 100%
rename from tools/libxc/xenctrlosdep.h
rename to tools/libxc/include/xenctrlosdep.h
tools/libxc/include/xenguest.h renamed from tools/libxc/xenguest.h +0 -0
similarity index 100%
rename from tools/libxc/xenguest.h
rename to tools/libxc/include/xenguest.h
tools/libxc/include/xentoollog.h renamed from tools/libxc/xentoollog.h +0 -0
similarity index 100%
rename from tools/libxc/xentoollog.h
rename to tools/libxc/include/xentoollog.h
tools/misc/Makefile +2 -0
index 69b1817..266fd16 100644
@@ -6,6 +6,8 @@ CFLAGS += -Werror
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenstore)
+# xen-hptool.c and xen-mfndump.c incorrectly use libxc internals
+CFLAGS += -I$(XEN_ROOT)/tools/libxc
 
 HDRS     = $(wildcard *.h)
 
tools/python/setup.py +2 -2
index 17ebb4a..a9cb9ad 100644
@@ -7,9 +7,9 @@ XEN_ROOT = "../.."
 extra_compile_args  = [ "-fno-strict-aliasing", "-Werror" ]
 
 PATH_XEN      = XEN_ROOT + "/tools/include"
-PATH_LIBXC    = XEN_ROOT + "/tools/libxc"
+PATH_LIBXC    = XEN_ROOT + "/tools/libxc/include"
 PATH_LIBXL    = XEN_ROOT + "/tools/libxl"
-PATH_XENSTORE = XEN_ROOT + "/tools/xenstore"
+PATH_XENSTORE = XEN_ROOT + "/tools/xenstore/include"
 
 xc = Extension("xc",
                extra_compile_args = extra_compile_args,
tools/xcutils/Makefile +2 -1
index 98706bf..f71703d 100644
@@ -15,7 +15,8 @@ PROGRAMS = readnotes lsevtchn
 
 CFLAGS += -Werror
 
-CFLAGS_readnotes.o  := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+# incorrectly uses libxc internals
+CFLAGS_readnotes.o  := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) -I$(XEN_ROOT)/tools/libxc
 CFLAGS_lsevtchn.o   := $(CFLAGS_libxenctrl)
 
 .PHONY: all
tools/xenpaging/Makefile +2 -1
index 548d9dd..054562d 100644
@@ -1,7 +1,8 @@
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS)
+# xenpaging.c and file_ops.c incorrectly use libxc internals
+CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) -I$(XEN_ROOT)/tools/libxc
 LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS)
 LDFLAGS += $(PTHREAD_LDFLAGS)
 
tools/xenstore/Makefile +5 -4
index e34bd41..2947d3e 100644
@@ -6,6 +6,7 @@ MINOR = 3
 
 CFLAGS += -Werror
 CFLAGS += -I.
+CFLAGS += -I./include
 CFLAGS += $(CFLAGS_libxenctrl)
 
 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
@@ -126,10 +127,10 @@ install: all
 	ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
 	ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so
 	$(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR)
-	$(INSTALL_DATA) xenstore.h $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_DATA) xenstore_lib.h $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_DATA) compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h
-	$(INSTALL_DATA) compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h
+	$(INSTALL_DATA) include/xenstore.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/xenstore_lib.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h
+	$(INSTALL_DATA) include/compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h
 	ln -sf xenstore-compat/xs.h  $(DESTDIR)$(INCLUDEDIR)/xs.h
 	ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xs_lib.h
 
tools/xenstore/include/compat/xs.h renamed from tools/xenstore/compat/xs.h +0 -0
similarity index 100%
rename from tools/xenstore/compat/xs.h
rename to tools/xenstore/include/compat/xs.h
tools/xenstore/include/compat/xs_lib.h renamed from tools/xenstore/compat/xs_lib.h +0 -0
similarity index 100%
rename from tools/xenstore/compat/xs_lib.h
rename to tools/xenstore/include/compat/xs_lib.h
tools/xenstore/include/xenstore.h renamed from tools/xenstore/xenstore.h +0 -0
similarity index 100%
rename from tools/xenstore/xenstore.h
rename to tools/xenstore/include/xenstore.h
tools/xenstore/include/xenstore_lib.h renamed from tools/xenstore/xenstore_lib.h +0 -0
similarity index 100%
rename from tools/xenstore/xenstore_lib.h
rename to tools/xenstore/include/xenstore_lib.h
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 52 lines · Stefano Stabellini

Also moves xc_dom.h to include as it is used often by other xen tools. Use the new include subdirectories to build Xen tools and qemu-xen.

Add the old libxc include path to the programs that need it to build, on a case by case basis and commeting that they shouldn't require internal libxc headers to build.

---

Changes in v2:

- squash the patches together to retain bisectibility;
- use the new include subdirectories to build xen tools, do not add the old libxc include path to CFLAGS_libxenctrl and the old xenstore include path to CFLAGS_libxenstore.

---
 tools/Makefile                               |    6 +++---
 tools/Rules.mk                               |    6 +++---
 tools/blktap2/drivers/Makefile               |    2 ++
 tools/libxc/Makefile                         |    6 +++---
 tools/libxc/{ => include}/xc_dom.h           |    0
 tools/libxc/{ => include}/xenctrl.h          |    0
 tools/libxc/{ => include}/xenctrlosdep.h     |    0
 tools/libxc/{ => include}/xenguest.h         |    0
 tools/libxc/{ => include}/xentoollog.h       |    0
 tools/misc/Makefile                          |    2 ++
 tools/python/setup.py                        |    4 ++--
 tools/xcutils/Makefile                       |    3 ++-
 tools/xenpaging/Makefile                     |    3 ++-
 tools/xenstore/Makefile                      |    9 +++++----
 tools/xenstore/{ => include}/compat/xs.h     |    0
 tools/xenstore/{ => include}/compat/xs_lib.h |    0
 tools/xenstore/{ => include}/xenstore.h      |    0
 tools/xenstore/{ => include}/xenstore_lib.h  |    0
 18 files changed, 24 insertions(+), 17 deletions(-)
 rename tools/libxc/{ => include}/xc_dom.h (100%)
 rename tools/libxc/{ => include}/xenctrl.h (100%)
 rename tools/libxc/{ => include}/xenctrlosdep.h (100%)
 rename tools/libxc/{ => include}/xenguest.h (100%)
 rename tools/libxc/{ => include}/xentoollog.h (100%)
 rename tools/xenstore/{ => include}/compat/xs.h (100%)
 rename tools/xenstore/{ => include}/compat/xs_lib.h (100%)
 rename tools/xenstore/{ => include}/xenstore.h (100%)
 rename tools/xenstore/{ => include}/xenstore_lib.h (100%)
tools/Makefile +0 -0
index f4aa200..5f32dcc 100644

tools/Makefile subdir-all-qemu-xen-dir: qemu-xen-dir-find · line 193

Quoted 9 lines
tools/Makefile +3 -3
@@ -188,9 +188,9 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--includedir=$(PREFIX)/lib/xen/include \
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
-		-I$(XEN_ROOT)/tools/libxc \
-		-I$(XEN_ROOT)/tools/xenstore \
-		-I$(XEN_ROOT)/tools/xenstore/compat \
+		-I$(XEN_ROOT)/tools/libxc/include \
+		-I$(XEN_ROOT)/tools/xenstore/include \
+		-I$(XEN_ROOT)/tools/xenstore/compat/include \

Not directly related to your patch but...

andrewcoop@andrewcoop:/local/xen.git/tools/qemu-xen-dir-remote$ git grep
"xs\.h"
configure:#include <xs.h>
configure:#include <xs.h>
configure:#include <xs.h>
configure:#include <xs.h>
include/hw/xen/xen_common.h:#  include <xs.h>

Isn't it time we got code like this off using the legacy xs.h?

Quoted 105 lines
tools/Makefile +0 -0
 		$(EXTRA_CFLAGS_QEMU_XEN)" \
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore \
tools/Rules.mk +3 -3
index 13d8fc1..53f51a8 100644
@@ -19,15 +19,15 @@ XEN_LIBVCHAN       = $(XEN_ROOT)/tools/libvchan
 
 CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 
-CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
+CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl.so
 SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
 
-CFLAGS_libxenguest = -I$(XEN_LIBXC) $(CFLAGS_xeninclude)
+CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenguest = $(XEN_LIBXC)/libxenguest.so
 SHLIB_libxenguest  = -Wl,-rpath-link=L$(XEN_LIBXC)
 
-CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_xeninclude)
+CFLAGS_libxenstore = -I$(XEN_XENSTORE)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenstore = $(XEN_XENSTORE)/libxenstore.so
 SHLIB_libxenstore  = -Wl,-rpath-link=$(XEN_XENSTORE)
 
tools/blktap2/drivers/Makefile +2 -0
index 1129ca1..7df9bc4 100644
@@ -16,6 +16,8 @@ CFLAGS    += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
 CFLAGS    += $(CFLAGS_libxenctrl)
 CFLAGS    += -D_GNU_SOURCE
 CFLAGS    += -DUSE_NFS_LOCKS
+# drivers/block-log.c incorrectly uses libxc internals
+CFLAGS    += -I$(XEN_ROOT)/tools/libxc
 
 ifeq ($(CONFIG_X86_64),y)
 CFLAGS            += -fPIC
tools/libxc/Makefile +3 -3
index f77677c..da59e10 100644
@@ -89,7 +89,7 @@ OSDEP_SRCS-y                 += xenctrl_osdep_ENOSYS.c
 -include $(XEN_TARGET_ARCH)/Makefile
 
 CFLAGS   += -Werror -Wmissing-prototypes
-CFLAGS   += -I. $(CFLAGS_xeninclude)
+CFLAGS   += -I. -I./include $(CFLAGS_xeninclude)
 
 # Needed for posix_fadvise64() in xc_linux.c
 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
@@ -140,12 +140,12 @@ install: build
 	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(LIBDIR)
 	ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so.$(MAJOR)
 	ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so
-	$(INSTALL_DATA) xenctrl.h xenctrlosdep.h xentoollog.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h include/xentoollog.h $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
 	$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(LIBDIR)
 	ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenguest.so.$(MAJOR)
 	ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenguest.so
-	$(INSTALL_DATA) xenguest.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/xenguest.h $(DESTDIR)$(INCLUDEDIR)
 
 .PHONY: TAGS
 TAGS:
tools/libxc/include/xc_dom.h renamed from tools/libxc/xc_dom.h +0 -0
similarity index 100%
rename from tools/libxc/xc_dom.h
rename to tools/libxc/include/xc_dom.h
tools/libxc/include/xenctrl.h renamed from tools/libxc/xenctrl.h +0 -0
similarity index 100%
rename from tools/libxc/xenctrl.h
rename to tools/libxc/include/xenctrl.h
tools/libxc/include/xenctrlosdep.h renamed from tools/libxc/xenctrlosdep.h +0 -0
similarity index 100%
rename from tools/libxc/xenctrlosdep.h
rename to tools/libxc/include/xenctrlosdep.h
tools/libxc/include/xenguest.h renamed from tools/libxc/xenguest.h +0 -0
similarity index 100%
rename from tools/libxc/xenguest.h
rename to tools/libxc/include/xenguest.h
tools/libxc/include/xentoollog.h renamed from tools/libxc/xentoollog.h +0 -0
similarity index 100%
rename from tools/libxc/xentoollog.h
rename to tools/libxc/include/xentoollog.h
tools/misc/Makefile +2 -0
index 69b1817..266fd16 100644
@@ -6,6 +6,8 @@ CFLAGS += -Werror
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenstore)
+# xen-hptool.c and xen-mfndump.c incorrectly use libxc internals
+CFLAGS += -I$(XEN_ROOT)/tools/libxc
 
 HDRS     = $(wildcard *.h)
 
tools/python/setup.py +0 -0
index 17ebb4a..a9cb9ad 100644

tools/python/setup.py XEN_ROOT = "../.." · line 12

Quoted 8 lines
tools/python/setup.py +2 -2
@@ -7,9 +7,9 @@ XEN_ROOT = "../.."
 extra_compile_args  = [ "-fno-strict-aliasing", "-Werror" ]
 
 PATH_XEN      = XEN_ROOT + "/tools/include"
-PATH_LIBXC    = XEN_ROOT + "/tools/libxc"
+PATH_LIBXC    = XEN_ROOT + "/tools/libxc/include"
 PATH_LIBXL    = XEN_ROOT + "/tools/libxl"
-PATH_XENSTORE = XEN_ROOT + "/tools/xenstore"
+PATH_XENSTORE = XEN_ROOT + "/tools/xenstore/include"

This breaks the .so references lower down, which will cause the python bits to fail to link.

You should use PATH_$FOO + "/include" in the include_dir lists only.

~Andrew

Quoted 74 lines
tools/python/setup.py +0 -0
 xc = Extension("xc",
                extra_compile_args = extra_compile_args,
tools/xcutils/Makefile +2 -1
index 98706bf..f71703d 100644
@@ -15,7 +15,8 @@ PROGRAMS = readnotes lsevtchn
 
 CFLAGS += -Werror
 
-CFLAGS_readnotes.o  := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+# incorrectly uses libxc internals
+CFLAGS_readnotes.o  := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) -I$(XEN_ROOT)/tools/libxc
 CFLAGS_lsevtchn.o   := $(CFLAGS_libxenctrl)
 
 .PHONY: all
tools/xenpaging/Makefile +2 -1
index 548d9dd..054562d 100644
@@ -1,7 +1,8 @@
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS)
+# xenpaging.c and file_ops.c incorrectly use libxc internals
+CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) -I$(XEN_ROOT)/tools/libxc
 LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS)
 LDFLAGS += $(PTHREAD_LDFLAGS)
 
tools/xenstore/Makefile +5 -4
index e34bd41..2947d3e 100644
@@ -6,6 +6,7 @@ MINOR = 3
 
 CFLAGS += -Werror
 CFLAGS += -I.
+CFLAGS += -I./include
 CFLAGS += $(CFLAGS_libxenctrl)
 
 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
@@ -126,10 +127,10 @@ install: all
 	ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
 	ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so
 	$(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR)
-	$(INSTALL_DATA) xenstore.h $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_DATA) xenstore_lib.h $(DESTDIR)$(INCLUDEDIR)
-	$(INSTALL_DATA) compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h
-	$(INSTALL_DATA) compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h
+	$(INSTALL_DATA) include/xenstore.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/xenstore_lib.h $(DESTDIR)$(INCLUDEDIR)
+	$(INSTALL_DATA) include/compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h
+	$(INSTALL_DATA) include/compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h
 	ln -sf xenstore-compat/xs.h  $(DESTDIR)$(INCLUDEDIR)/xs.h
 	ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xs_lib.h
 
tools/xenstore/include/compat/xs.h renamed from tools/xenstore/compat/xs.h +0 -0
similarity index 100%
rename from tools/xenstore/compat/xs.h
rename to tools/xenstore/include/compat/xs.h
tools/xenstore/include/compat/xs_lib.h renamed from tools/xenstore/compat/xs_lib.h +0 -0
similarity index 100%
rename from tools/xenstore/compat/xs_lib.h
rename to tools/xenstore/include/compat/xs_lib.h
tools/xenstore/include/xenstore.h renamed from tools/xenstore/xenstore.h +0 -0
similarity index 100%
rename from tools/xenstore/xenstore.h
rename to tools/xenstore/include/xenstore.h
tools/xenstore/include/xenstore_lib.h renamed from tools/xenstore/xenstore_lib.h +0 -0
similarity index 100%
rename from tools/xenstore/xenstore_lib.h
rename to tools/xenstore/include/xenstore_lib.h
#2 lore raw
Quoted 11 lines · Andrew Cooper

Not directly related to your patch but...

andrewcoop@andrewcoop:/local/xen.git/tools/qemu-xen-dir-remote$ git grep
"xs\.h"
configure:#include <xs.h>
configure:#include <xs.h>
configure:#include <xs.h>
configure:#include <xs.h>
include/hw/xen/xen_common.h:#  include <xs.h>

Isn't it time we got code like this off using the legacy xs.h?

So long as that code also wants to build against older Xen we should tolerate them preferring the older headers.

#3 lore raw
Quoted 12 lines · Ian Campbell
Quoted 10 lines · Andrew Cooper

Not directly related to your patch but...

andrewcoop@andrewcoop:/local/xen.git/tools/qemu-xen-dir-remote$ git grep
"xs\.h"
configure:#include <xs.h>
configure:#include <xs.h>
configure:#include <xs.h>
configure:#include <xs.h>
include/hw/xen/xen_common.h:#  include <xs.h>
Quoted 6 lines
Quoted 1 line

Isn't it time we got code like this off using the legacy xs.h?

So long as that code also wants to build against older Xen we should tolerate them preferring the older headers.

The whole purpose of configure is to try and hide that stuff away. Surely it should try looking for xenstore.h and, failing that, look for xs.h and fill in some variable?

We know for certain whether the version of qemu pointed to by xen.git need the legacy headers still.

~Andrew

#4 lore raw
Quoted 20 lines · Andrew Cooper
Quoted 12 lines · Ian Campbell
Quoted 10 lines · Andrew Cooper

Not directly related to your patch but...

andrewcoop@andrewcoop:/local/xen.git/tools/qemu-xen-dir-remote$ git grep
"xs\.h"
configure:#include <xs.h>
configure:#include <xs.h>
configure:#include <xs.h>
configure:#include <xs.h>
include/hw/xen/xen_common.h:#  include <xs.h>
Quoted 6 lines
Quoted 1 line

Isn't it time we got code like this off using the legacy xs.h?

So long as that code also wants to build against older Xen we should tolerate them preferring the older headers.

Quoted 3 lines

The whole purpose of configure is to try and hide that stuff away. Surely it should try looking for xenstore.h and, failing that, look for xs.h and fill in some variable?

Qemu's ./configure is not autoconf.

In any case while it could do what you suggest I don't think these spare headers are causing us such grief that we need to make waves about getting rid of them.

Quoted 5 lines

We know for certain whether the version of qemu pointed to by xen.git need the legacy headers still.

~Andrew

#5 lore raw
In reply to Andrew Cooper
Quoted 17 lines · Andrew Cooper

tools/python/setup.py XEN_ROOT = "../.." · line 12

Quoted 13 lines
tools/python/setup.py +2 -2
index 17ebb4a..a9cb9ad 100644
@@ -7,9 +7,9 @@ XEN_ROOT = "../.."
 extra_compile_args  = [ "-fno-strict-aliasing", "-Werror" ]
 
 PATH_XEN      = XEN_ROOT + "/tools/include"
-PATH_LIBXC    = XEN_ROOT + "/tools/libxc"
+PATH_LIBXC    = XEN_ROOT + "/tools/libxc/include"
 PATH_LIBXL    = XEN_ROOT + "/tools/libxl"
-PATH_XENSTORE = XEN_ROOT + "/tools/xenstore"
+PATH_XENSTORE = XEN_ROOT + "/tools/xenstore/include"

This breaks the .so references lower down, which will cause the python bits to fail to link.

Quoted 1 line

You should use PATH_$FOO + "/include" in the include_dir lists only.

Yes, you are right. I'll make the change.

#6 lore raw
In reply to Stefano Stabellini
Quoted 1 line · Stefano Stabellini

Also moves xc_dom.h to include as it is used often by other xen tools.

I think you could say here "expected to be used by other in-tree xen tools despite not currently being installed" or something to make it clear that this isn't one of the many bad cases.

Quoted 4 lines

Use the new include subdirectories to build Xen tools and qemu-xen.

Add the old libxc include path to the programs that need it to build, on a case by case basis and commeting that they shouldn't require

"commenting"

Quoted 3 lines

internal libxc headers to build.

This looks good to me, but ISTR you saying something about a qemu-trad update which needed to be synchronised?

Ian.

#7 lore raw
Quoted 12 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

Also moves xc_dom.h to include as it is used often by other xen tools.

I think you could say here "expected to be used by other in-tree xen tools despite not currently being installed" or something to make it clear that this isn't one of the many bad cases.

Quoted 4 lines

Use the new include subdirectories to build Xen tools and qemu-xen.

Add the old libxc include path to the programs that need it to build, on a case by case basis and commeting that they shouldn't require

Quoted 8 lines

"commenting"

Quoted 3 lines

internal libxc headers to build.

This looks good to me, but ISTR you saying something about a qemu-trad update which needed to be synchronised?

Yes, the qemu-xen-traditional patch is:

http://marc.info/?l=xen-devel&m=140500949902568

It has no comments yet, so I didn't send it again.

#8 lore raw
Quoted 19 lines · Stefano Stabellini
Quoted 18 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

Also moves xc_dom.h to include as it is used often by other xen tools.

I think you could say here "expected to be used by other in-tree xen tools despite not currently being installed" or something to make it clear that this isn't one of the many bad cases.

Quoted 4 lines

Use the new include subdirectories to build Xen tools and qemu-xen.

Add the old libxc include path to the programs that need it to build, on a case by case basis and commeting that they shouldn't require

"commenting"

Quoted 3 lines

internal libxc headers to build.

Quoted 8 lines
Quoted 2 lines

This looks good to me, but ISTR you saying something about a qemu-trad update which needed to be synchronised?

Yes, the qemu-xen-traditional patch is:

http://marc.info/?l=xen-devel&m=140500949902568

It has no comments yet, so I didn't send it again.

Ah, your reply to Andrew confusingly implied that it was a WIP patch against xen.git so I ignored it in favour of this patch. Please tag such patches appropriate in the subject line.

In any case the reliance on that qemu patch really should have been described here somewhere or you risk a committer who wasn't party to previous conversations (or who hasn't made the link) committing it (or wasting time trying).

Ian.