debuggers.hg

view xen/include/Makefile @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents 95ea2052b41b
children
line source
1 XEN_ROOT:=$(BASEDIR)/..
2 include $(XEN_ROOT)/Config.mk
4 ifneq ($(CONFIG_COMPAT),)
6 compat-arch-$(CONFIG_X86) := x86_32
8 headers-y := \
9 compat/callback.h \
10 compat/elfnote.h \
11 compat/event_channel.h \
12 compat/features.h \
13 compat/grant_table.h \
14 compat/kexec.h \
15 compat/memory.h \
16 compat/nmi.h \
17 compat/physdev.h \
18 compat/platform.h \
19 compat/sched.h \
20 compat/tmem.h \
21 compat/trace.h \
22 compat/vcpu.h \
23 compat/version.h \
24 compat/xen.h \
25 compat/xencomm.h \
26 compat/xenoprof.h
27 headers-$(CONFIG_X86) += compat/arch-x86/xen-mca.h
28 headers-$(CONFIG_X86) += compat/arch-x86/xen.h
29 headers-$(CONFIG_X86) += compat/arch-x86/xen-$(compat-arch-y).h
30 headers-y += compat/arch-$(compat-arch-y).h compat/xlat.h
32 cppflags-y := -include public/xen-compat.h
33 cppflags-$(CONFIG_X86) += -m32
35 # 8-byte types are 4-byte aligned on x86_32 ...
36 prefix-$(CONFIG_X86) := \#pragma pack(4)
37 suffix-$(CONFIG_X86) := \#pragma pack()
39 endif
41 public-$(CONFIG_X86) := $(wildcard public/arch-x86/*.h public/arch-x86/*/*.h)
42 public-$(CONFIG_IA64) := $(wildcard public/arch-ia64/*.h public/arch-ia64/*/*.h)
44 .PHONY: all
45 all: $(headers-y)
47 compat/%.h: compat/%.i Makefile $(BASEDIR)/tools/compat-build-header.py
48 set -e; id=_$$(echo $@ | tr '[:lower:]-/.' '[:upper:]___'); \
49 echo "#ifndef $$id" >$@.new; \
50 echo "#define $$id" >>$@.new; \
51 echo "#include <xen/compat.h>" >>$@.new; \
52 $(if $(filter-out compat/arch-%.h,$@),echo "#include <$(patsubst compat/%,public/%,$@)>" >>$@.new;) \
53 $(if $(prefix-y),echo "$(prefix-y)" >>$@.new;) \
54 grep -v '^# [0-9]' $< | \
55 $(PYTHON) $(BASEDIR)/tools/compat-build-header.py | uniq >>$@.new; \
56 $(if $(suffix-y),echo "$(suffix-y)" >>$@.new;) \
57 echo "#endif /* $$id */" >>$@.new
58 mv -f $@.new $@
60 compat/%.i: compat/%.c Makefile
61 $(CPP) -include public/xen-compat.h $(filter-out -M% .%.d,$(CFLAGS)) $(cppflags-y) -o $@ $<
63 compat/%.c: public/%.h xlat.lst Makefile $(BASEDIR)/tools/compat-build-source.py
64 mkdir -p $(@D)
65 grep -v 'DEFINE_XEN_GUEST_HANDLE(long)' $< | \
66 $(PYTHON) $(BASEDIR)/tools/compat-build-source.py >$@.new
67 mv -f $@.new $@
69 compat/xlat.h: xlat.lst $(filter-out compat/xlat.h,$(headers-y)) $(BASEDIR)/tools/get-fields.sh Makefile
70 export PYTHON=$(PYTHON); \
71 grep -v '^[ ]*#' xlat.lst | \
72 while read what name hdr; do \
73 $(SHELL) $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $$(echo compat/$$hdr | sed 's,@arch@,$(compat-arch-y),g') || exit $$?; \
74 done >$@.new
75 mv -f $@.new $@
77 ifeq ($(XEN_TARGET_ARCH),$(XEN_COMPILE_ARCH))
78 # public/arch-ia64.h explicitly bails on __STRICT_ANSI__
79 ifeq ($(CONFIG_IA64),)
81 all: headers.chk
83 headers.chk: $(filter-out public/arch-% public/%ctl.h public/xsm/% public/%hvm/save.h, $(wildcard public/*.h public/*/*.h) $(public-y)) Makefile
84 for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -Werror -S -o /dev/null -xc $$i || exit 1; echo $$i; done >$@.new
85 mv $@.new $@
87 endif
88 endif
90 clean::
91 rm -rf compat headers.chk