direct-io.hg

view buildconfigs/Rules.mk @ 7172:9c6b39746b78

Fix localhost live migration. We were overvigorously wiping out the store
entries when a domain closed and on save, which meant that the /vm entries
disappeared when a localhost migration occurred. XendCheckpoint has had extra
exception handling and logging added. It also now calls back through
XendDomain.restore_,which has the correct locking semantics to prevent race
conditions during migration.

Added assertions to XendCheckpoint to ensure that the channels are set after
XendDomainInfo.restore. I don't see why they would not be, and the old code
meant that in the case that they were not, IntroduceDomain would not be called
on the new domain, breaking Xend restart.

relocate calls through XendDomain.domain_restore_fd rather than directly to
XendCheckpoint to isolate XendCheckpoint from the rest of the world, and to
allow XendDomain to pass itself into XendCheckpoint for a callback.

Simplify the XendCheckpoint / XendDomainInfo interlock, giving only two
states, OK and TERMINATED. If XendCheckpoint asks for a suspend, but sees a
shutdown, it is valid for it to proceed -- either way the domain has stopped.
Higher level tools may wish to disallow this, but at the very least, there is
no sense in waiting for a suspend that will never come.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Tue Oct 04 11:14:50 2005 +0100 (2005-10-04)
parents 4e1031ce3bc2
children aad1d3e231ff 93e27f7ca8a8 61b3b357d827
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 ($(XEN_TARGET_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: