view extras/mini-os/Makefile @ 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 <>
author emellor@ewan
date Tue Oct 04 11:14:50 2005 +0100 (2005-10-04)
parents 06d84bf87159
children c176d2e45117
line source
1 debug ?= y
3 include $(CURDIR)/../../
8 # NB. '-Wcast-qual' is nasty, so I omitted it.
9 CFLAGS := -fno-builtin -Wall -Werror -Iinclude/ -Wredundant-decls -Wno-format
10 CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
12 ifeq ($(TARGET_ARCH),x86_32)
13 CFLAGS += -m32 -march=i686
14 LDFLAGS := -m elf_i386
15 endif
17 ifeq ($(TARGET_ARCH),x86_64)
18 CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks
19 CFLAGS += -fno-asynchronous-unwind-tables
20 LDFLAGS := -m elf_x86_64
21 endif
23 ifeq ($(debug),y)
24 CFLAGS += -g
25 else
26 CFLAGS += -O3
27 endif
29 TARGET := mini-os
32 OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
33 OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
34 OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
36 HDRS := $(wildcard include/*.h)
37 HDRS += $(wildcard include/xen/*.h)
39 default: $(TARGET)
41 links:
42 [ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
43 [ -e xenbus/xenstored.h ] || ln -sf ../../../tools/xenstore/xenstored.h xenbus/xenstored.h
45 $(TARGET): links $(OBJS)
46 $(LD) -N -T minios-$(TARGET_ARCH).lds $(OBJS) -o $@.elf
47 gzip -f -9 -c $@.elf >$@.gz
49 clean:
50 find . -type f -name '*.o' | xargs rm -f
51 rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
52 find . -type l | xargs rm -f
54 %.o: %.c $(HDRS) Makefile
55 $(CC) $(CFLAGS) -c $< -o $@
57 %.o: %.S $(HDRS) Makefile
58 $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@