WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [Xen-changelog] Define Xen interface version for tools b

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] Re: [Xen-changelog] Define Xen interface version for tools build.
From: Muli Ben-Yehuda <mulix@xxxxxxxxx>
Date: Thu, 06 Apr 2006 12:04:52 +0300
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 06 Apr 2006 02:06:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <69cd31cce8c5fba523604f999a516e67@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <E1FRDpR-0003Lw-7l@xxxxxxxxxxxxxxxxxxxxx> <20060406055438.GA16153@xxxxxxxxxxxxxxxxxxx> <69cd31cce8c5fba523604f999a516e67@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.11+cvs20060126
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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel