Muli Ben-Yehuda
2006-Apr-06 05:54 UTC
[Xen-devel] Re: [Xen-changelog] Define Xen interface version for tools build.
On Wed, Apr 05, 2006 at 07:38:08PM +0000, Xen patchbot -unstable wrote:> # HG changeset patch > # User kaf24@firebug.cl.cam.ac.uk > # Node ID d1ddd7d35ed5387467cf4022e4d87b5bbca74553 > # Parent 806d042527619a985d69d57d93e670a4e150eb44 > Define Xen interface version for tools build. > > Signed-off-by: Keir Fraser <keir@xensource.com> > > diff -r 806d04252761 -r d1ddd7d35ed5 tools/Rules.mk > --- a/tools/Rules.mk Wed Apr 5 09:37:37 2006 > +++ b/tools/Rules.mk Wed Apr 5 09:41:11 2006 > @@ -11,6 +11,8 @@ > XEN_LIBXENSTAT = $(XEN_ROOT)/tools/xenstat/libxenstat/src > > X11_LDPATH = -L/usr/X11R6/$(LIBDIR) > + > +CFLAGS += -D__XEN_INTERFACE_VERSION__=0x00030101This is now another place you have to remember to change the version string. Can we stick it in its own file with nothing else and have other users include it? Cheers, Muli -- Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Apr-06 06:52 UTC
[Xen-devel] Re: [Xen-changelog] Define Xen interface version for tools build.
On 6 Apr 2006, at 06:54, Muli Ben-Yehuda wrote:>> X11_LDPATH = -L/usr/X11R6/$(LIBDIR) >> + >> +CFLAGS += -D__XEN_INTERFACE_VERSION__=0x00030101 > > This is now another place you have to remember to change the version > string. Can we stick it in its own file with nothing else and have > other users include it?Where would you place it such that it''s guaranteed to be included everywhere? One option is to define as 0xFFFFFFFF and have xen-compat.h rewrite that to __XEN_LATEST_INTERFACE_VERSION__. Then we''d never need to update the tools version as it would always get the latest interface. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Muli Ben-Yehuda
2006-Apr-06 09:04 UTC
[Xen-devel] Re: [Xen-changelog] Define Xen interface version for tools build.
On Thu, Apr 06, 2006 at 07:52:32AM +0100, Keir Fraser wrote:> > On 6 Apr 2006, at 06:54, Muli Ben-Yehuda wrote: > > >> X11_LDPATH = -L/usr/X11R6/$(LIBDIR) > >>+ > >>+CFLAGS += -D__XEN_INTERFACE_VERSION__=0x00030101 > > > >This is now another place you have to remember to change the version > >string. Can we stick it in its own file with nothing else and have > >other users include it? > > Where would you place it such that it''s guaranteed to be included > everywhere?How about something like the attached? - define XEN_LATEST_INTERFACE_VERSION in Config.mk - for the tools, it''s included from tools/Makefile directly - for the Xen and kernel builds, generate public/interface.h with it and include that. - this has one drawback - the public/ headers aren''t self contained any more, since interface.h needs to be generated before it''s used. The only case is this bits us is if someone copies include/public.h and tries to use that out of the tree, which doesn''t seem like a very likely occurance. Comments? diff -r ece9b5710b29 Config.mk --- a/Config.mk Thu Apr 06 00:59:18 2006 +0100 +++ b/Config.mk Thu Apr 06 12:02:56 2006 +0300 @@ -1,4 +1,6 @@ # -*- mode: Makefile; -*- + +export XEN_LATEST_INTERFACE_VERSION = 0x00030101 # A debug build of Xen and tools? debug ?= n diff -r ece9b5710b29 Makefile --- a/Makefile Thu Apr 06 00:59:18 2006 +0100 +++ b/Makefile Thu Apr 06 12:02:56 2006 +0300 @@ -69,6 +69,7 @@ install-tools: $(MAKE) -C tools install install-kernels: + make -C xen include/public/interface.h for i in $(XKERNELS) ; do $(MAKE) $$i-install || exit 1; done install-docs: diff -r ece9b5710b29 tools/Rules.mk --- a/tools/Rules.mk Thu Apr 06 00:59:18 2006 +0100 +++ b/tools/Rules.mk Thu Apr 06 12:02:56 2006 +0300 @@ -12,7 +12,7 @@ XEN_LIBXENSTAT = $(XEN_ROOT)/tools/x X11_LDPATH = -L/usr/X11R6/$(LIBDIR) -CFLAGS += -D__XEN_INTERFACE_VERSION__=0x00030101 +CFLAGS += -D__XEN_INTERFACE_VERSION__=$(XEN_LATEST_INTERFACE_VERSION) %.opic: %.c $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $< diff -r ece9b5710b29 xen/Makefile --- a/xen/Makefile Thu Apr 06 00:59:18 2006 +0100 +++ b/xen/Makefile Thu Apr 06 12:02:56 2006 +0300 @@ -54,7 +54,7 @@ debug: FORCE $(TARGET): delete-unfresh-files $(MAKE) -C tools - $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/compile.h + $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/compile.h include/public/interface.h $(MAKE) -f $(BASEDIR)/Rules.mk include/xen/acm_policy.h [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) asm-offsets.s @@ -66,6 +66,9 @@ delete-unfresh-files: delete-unfresh-files: @if [ ! -r include/xen/compile.h -o -O include/xen/compile.h ]; then \ rm -f include/xen/{banner,compile}.h; \ + fi + @if [ ! -r include/public/interface.h -o -O include/public/interface.h ]; then \ + rm -f include/public/interface.h; \ fi # acm_policy.h contains security policy for Xen @@ -103,6 +106,13 @@ include/xen/banner.h: tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) > $@.new @mv -f $@.new $@ +# interface.h contains our interface version information. Rebuilt on every ''make'' invocation. +include/public/interface.h: LANG=C +include/public/interface.h: include/public/interface.h.in + @sed -e ''s/@@xenlatestinterfaceversion@@/$(XEN_LATEST_INTERFACE_VERSION)/g'' \ + < include/public/interface.h.in > $@.new + @mv -f $@.new $@ + include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s @(set -e; \ echo "/*"; \ diff -r ece9b5710b29 xen/include/public/xen-compat.h --- a/xen/include/public/xen-compat.h Thu Apr 06 00:59:18 2006 +0100 +++ b/xen/include/public/xen-compat.h Thu Apr 06 12:02:56 2006 +0300 @@ -9,7 +9,7 @@ #ifndef __XEN_PUBLIC_XEN_COMPAT_H__ #define __XEN_PUBLIC_XEN_COMPAT_H__ -#define __XEN_LATEST_INTERFACE_VERSION__ 0x00030101 +#include "interface.h" #if defined(__XEN__) /* Xen is built with matching headers and implements the latest interface. */ diff -r ece9b5710b29 xen/include/public/interface.h.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xen/include/public/interface.h.in Thu Apr 06 12:02:56 2006 +0300 @@ -0,0 +1,1 @@ +#define __XEN_LATEST_INTERFACE_VERSION__ @@xenlatestinterfaceversion@@ -- Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Apr-06 09:20 UTC
[Xen-devel] Re: [Xen-changelog] Define Xen interface version for tools build.
On 6 Apr 2006, at 10:04, Muli Ben-Yehuda wrote:> How about something like the attached? > - define XEN_LATEST_INTERFACE_VERSION in Config.mk > - for the tools, it''s included from tools/Makefile directly > - for the Xen and kernel builds, generate public/interface.h with it > and include that. > - this has one drawback - the public/ headers aren''t self contained > any more, since interface.h needs to be generated before it''s > used. The only case is this bits us is if someone copies > include/public.h and tries to use that out of the tree, which doesn''t > seem like a very likely occurance.We''d like to avoid the kernel sparse tree from becoming very intertwined with our repository''s build system. I like the current method of specifying the interface version via Kconfig, and I think the independence that gains us outweighs the hassle of having to update both the Kconfig and Xen''s xen-compat.h. The tools definition is a bit of a pain I agree. Hence the suggestion we pin it to always select the latest interface version, since we currently always build tools and hypervisor as a matched pair. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Muli Ben-Yehuda
2006-Apr-06 09:56 UTC
[Xen-devel] Re: [Xen-changelog] Define Xen interface version for tools build.
On Thu, Apr 06, 2006 at 10:20:07AM +0100, Keir Fraser wrote:> We''d like to avoid the kernel sparse tree from becoming very > intertwined with our repository''s build system. I like the current > method of specifying the interface version via Kconfig,Kconfig only specifies the interface version the kernel supports, not the "latest Xen interface version". Inherenly specifying the latet interface version Xen supports should be done in a Xen specific file. We are currently using the same file (xen-compat.h) in both Xen and the kernel build, which is pretty warty. Perhaps the check against the Xen version should be done only in run time?> and I think the > independence that gains us outweighs the hassle of having to update > both the Kconfig and Xen''s xen-compat.h.Sure, it''s not a major issue. Just one (more) potential headache.> The tools definition is a bit of a pain I agree. Hence the suggestion > we pin it to always select the latest interface version, since we > currently always build tools and hypervisor as a matched pair.I agree that the kernel should be seperate from Xen. If the kernel and Xen each their own copy of xen-compat.h, we could have one (shared) definition for Xen and tools and one definition for the kernel. Are there any plans to switch to the seperate kernel hg tree as the "main" kernel repository instead of the sparse tree soon? Cheers, Muli -- Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel