ia64/xen-unstable

view buildconfigs/Rules.mk @ 7072:f9296342d9b2

Detangle the restart/reboot/halt/save/restore code. There is now one point
for management of shutdown state, XendDomainInfo.refreshShutdown, which is
able to cope whatever the current state of the domain. This fixes bug #124:
running reboot within a domU doesn't bring the domain back up after shutdown,
and bug #256: "xm reboot" could not make domU reboot.

Fix the refreshing inside XendDomain to ensure that the values returned by xm
list reflect reality correctly. We were removing XendDomainInfo instances,
but not creating them on start-up, so if xend were restarted, domain
information was being lost.

Merge XendDomain.dom0_unknown and initial_refresh into
XendDomainInfo.recreate.

Catch exceptions inside callInfo, and reraise them as XendErrors.

Remove unused XendDomain.close.

Further improvements are needed to XendDomainInfo to ensure that it avoids all
race conditions on shutdown, and can cope correctly with xend restarting
during a shutdown.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Tue Sep 27 13:53:06 2005 +0100 (2005-09-27)
parents 06d84bf87159
children 4e1031ce3bc2 93e27f7ca8a8
line source
2 include Config.mk
4 # We expect these two to already be set if people
5 # are using the top-level Makefile
6 DISTDIR ?= $(CURDIR)/dist
7 DESTDIR ?= $(DISTDIR)/install
9 ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
10 ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
12 .PHONY: mkpatches mrproper
14 # Setup pristine search path
15 PRISTINE_SRC_PATH ?= .:..
16 vpath pristine-% $(PRISTINE_SRC_PATH)
18 # By default, build Linux with ARCH=xen (overridden by some non arch's)
19 ifneq ($(ARCH),ia64)
20 LINUX_ARCH ?= xen
21 else
22 LINUX_ARCH ?= ia64
23 endif
25 # Expand Linux series to Linux version
26 LINUX_SERIES ?= 2.6
28 # Setup Linux search path
29 LINUX_SRC_PATH ?= .:..
30 vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
32 # download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
33 linux-%.tar.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$*)).$(word 2,$(subst ., ,$*))
34 linux-%.tar.bz2:
35 @echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
36 wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$@ -O./$@
38 # Expand NetBSD release to NetBSD version
39 NETBSD_RELEASE ?= 2.0
40 NETBSD_VER ?= $(patsubst netbsd-%-xen-sparse,%,$(wildcard netbsd-$(NETBSD_RELEASE)*-xen-sparse))
41 NETBSD_CVSSNAP ?= 20050309
43 # Setup NetBSD search path
44 NETBSD_SRC_PATH ?= .:..
45 vpath netbsd-%.tar.bz2 $(NETBSD_SRC_PATH)
47 # download a pristine NetBSD tarball if there isn't one in NETBSD_SRC_PATH
48 netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2:
49 @echo "Cannot find $@ in path $(NETBSD_SRC_PATH)"
50 wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/$@ -O./$@
52 netbsd-%.tar.bz2: netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
53 ln -fs $< $@
55 ifeq ($(OS),linux)
56 OS_VER = $(LINUX_VER)
57 else
58 OS_VER = $(NETBSD_VER)
59 endif
61 pristine-%: pristine-%/.valid-pristine
62 @true
64 pristine-%/.valid-pristine: %.tar.bz2
65 rm -rf tmp-pristine-$* $(@D)
66 mkdir -p tmp-pristine-$*
67 tar -C tmp-pristine-$* -jxf $<
68 -@rm tmp-pristine-$*/pax_global_header
69 mv tmp-pristine-$*/* $(@D)
70 @rm -rf tmp-pristine-$*
71 touch $(@D)/.hgskip
72 touch $@ # update timestamp to avoid rebuild
74 PATCHDIRS := $(wildcard patches/*-*)
76 ifneq ($(PATCHDIRS),)
77 -include $(patsubst %,%/.makedep,$(PATCHDIRS))
79 $(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep:
80 @echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
82 clean::
83 rm -f patches/*/.makedep
85 ref-%/.valid-ref: pristine-%/.valid-pristine
86 rm -rf $(@D)
87 cp -al $(<D) $(@D)
88 ([ -d patches/$* ] && \
89 for i in patches/$*/*.patch ; do ( cd $(@D) ; patch -p1 <../$$i || exit 1 ) ; done) || true
90 touch $@ # update timestamp to avoid rebuild
91 endif
93 %-build:
94 $(MAKE) -f buildconfigs/mk.$* build
96 %-delete:
97 $(MAKE) -f buildconfigs/mk.$* delete
99 %-clean:
100 $(MAKE) -f buildconfigs/mk.$* clean
102 %-config:
103 $(MAKE) -f buildconfigs/mk.$* config
105 %-xen.patch: ref-%/.valid-ref
106 rm -rf tmp-$@
107 cp -al $(<D) tmp-$@
108 ( cd $*-xen-sparse && ./mkbuildtree ../tmp-$@ )
109 diff -Nurp $(<D) tmp-$@ > $@ || true
110 rm -rf tmp-$@
112 %-mrproper: %-mrproper-extra
113 rm -rf pristine-$(*)* ref-$(*)* $*.tar.bz2
114 rm -rf $*-xen.patch
116 netbsd-%-mrproper-extra:
117 rm -rf netbsd-$*-tools netbsd-$*-tools.tar.bz2
118 rm -f netbsd-$*-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
120 %-mrproper-extra:
121 @: # do nothing
123 config-update-pae:
124 ifeq ($(XEN_TARGET_X86_PAE),y)
125 sed -e 's!^CONFIG_HIGHMEM4G=y$$!\# CONFIG_HIGHMEM4G is not set!;s!^\# CONFIG_HIGHMEM64G is not set$$!CONFIG_HIGHMEM64G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE)
126 else
127 grep '^CONFIG_HIGHMEM64G=y' $(CONFIG_FILE) >/dev/null && ( sed -e 's!^CONFIG_HIGHMEM64G=y$$!\# CONFIG_HIGHMEM64G is not set!;s!^\# CONFIG_HIGHMEM4G is not set$$!CONFIG_HIGHMEM4G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE) ) || true
128 endif
130 # never delete any intermediate files.
131 .SECONDARY: