Define Xen interface version for tools build.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 12 lines · Xen patchbot -unstable
# HG changeset patch
# User [email protected]
# Node IDd1ddd7d35ed5387467cf4022e4d87b5bbca74553# Parent806d042527619a985d69d57d93e670a4e150eb44Define Xen interface version for tools build.Signed-off-by Keir Fraser <[email protected]>diff -r
806d04252761-rd1ddd7d35ed5tools/Rules.mk
tools/Rules.mk line 15
Quoted 5 lines
tools/Rules.mk +2
-0@@ -11,6 +11,8 @@ XEN_LIBXENSTAT = $(XEN_ROOT)/tools/xenstat/libxenstat/src 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?
Cheers,
Muli
Signature · 2 lines
Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/
Quoted 7 lines · Muli Ben-Yehuda
Review
Quoted 3 lines
X11_LDPATH= -L/usr/X11R6/$(LIBDIR)(quoted diff) +2
-0+ +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?
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
Quoted 11 lines · Keir Fraser
Quoted 7 lines · Muli Ben-Yehuda
Review
Quoted 3 lines
X11_LDPATH= -L/usr/X11R6/$(LIBDIR)(quoted diff) +2
-0+ +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?
Quoted 2 lines
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?
Config.mk +2 -0
@@ -1,4 +1,6 @@ # -*- mode: Makefile; -*- + +export XEN_LATEST_INTERFACE_VERSION = 0x00030101 # A debug build of Xen and tools? debug ?= n
Makefile +1 -0
@@ -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:
tools/Rules.mk +1 -1
@@ -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 $@ $<
xen/Makefile +11 -1
@@ -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) > [email protected] @mv -f [email protected] $@ +# 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 > [email protected] + @mv -f [email protected] $@ + include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s @(set -e; \ echo "/*"; \
xen/include/public/xen-compat.h +1 -1
@@ -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. */
xen/include/public/interface.h.in new file +1 -0
@@ -0,0 +1,1 @@ +#define __XEN_LATEST_INTERFACE_VERSION__ @@xenlatestinterfaceversion@@
Signature · 2 lines
Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/
Quoted 10 lines · Muli Ben-Yehuda
How about something like the attached?
- defineXEN_LATEST_INTERFACE_VERSIONin Config.mk
- for the tools, it's included fromtools/Makefiledirectly
- for the Xen and kernel builds, generatepublic/interface.hwith it and include that.
- this has one drawback - the public/ headers aren't self contained any more, sinceinterface.hneeds to be generated before it's used. The only case is this bits us is if someone copiesinclude/public.hand 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
Quoted 3 lines · Keir Fraser
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?
Quoted 3 lines
and I think the
independence that gains us outweighs the hassle of having to update both theKconfigand Xen'sxen-compat.h.
Sure, it's not a major issue. Just one (more) potential headache.
Quoted 3 lines
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
Signature · 2 lines
Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/