ia64/xen-unstable

view buildconfigs/select-repository @ 19807:468561f3c8ee

Only allow DOMCTL_max_vcpus to increase vcpus from zero.

Otherwise reallocation of the vcpus array is unsafe.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 23 11:10:29 2009 +0100 (2009-06-23)
parents f6520678755a
children
line source
1 #!/bin/sh
3 ME=$(basename $0)
5 if [ $# -lt 1 ] || [ $# -gt 2 ] ; then
6 echo "usage: $ME <repository-name> [search-path]" 1>&2
7 exit 1;
8 fi
10 REPO=$1
11 LINUX_SRC_PATH=$2
13 if [ X"${LINUX_SRC_PATH}" != X ] ; then
14 echo "$ME: Searching \`${LINUX_SRC_PATH}' for $REPO" 1>&2
15 IFS_saved="$IFS"
16 IFS=:
17 for i in $LINUX_SRC_PATH ; do
18 # Ignore current directory since we will almost certainly find
19 # the target directory there which breaks updating (there's no
20 # point updating from yourself!).
21 if [ X"." = X"${i}" ] ; then
22 echo "$ME: Ignoring \`.'" 1>&2
23 continue
24 fi
26 if [ -d "$i/$REPO/.hg" ] ; then
27 echo "$ME: Found $i/$REPO" 1>&2
28 echo "$i/$REPO"
29 exit 0
30 fi
31 done
32 IFS="$IFS_saved"
33 fi
35 if [ -d ${XEN_ROOT}/.hgxxx ] ; then
36 XEN=$(hg -R ${XEN_ROOT} path default)
37 if [ $? -ne 0 ] || [ X"$XEN" = "X" ] ; then
38 echo "$ME: Unable to determine Xen repository parent." 1>&2
39 exit 1;
40 fi
42 BASE=$(dirname ${XEN})
43 if [ $? -ne 0 ] || [ X"$BASE" = "X" ] ; then
44 echo "$ME: Unable to determine Xen repository base." 1>&2
45 exit 1;
46 fi
47 if [ -d "$XEN" ] && [ ! -d "$BASE/$REPO" ] ; then
48 echo "$ME: No such dir: $BASE/$REPO" 1>&2
49 exit 1
50 fi
52 echo "$ME: Found ${BASE}/${REPO}" 1>&2
54 # If ${BASE}/${REPO} is a local directory then prepend file:// so that
55 # the test in src.hg-clone will fail and we will clone instead of
56 # linking this repository. We only want to link repositories which
57 # were found via LINUX_SRC_PATH.
58 if [ -d "${BASE}/${REPO}" ] ; then
59 echo "file://${BASE}/${REPO}"
60 else
61 echo ${BASE}/${REPO}
62 fi
63 else
64 echo "Unable to determine path to Linux source tree." 1>&2
65 echo "Falling back to linux-2.6.18-xen Mercurial repository." 1>&2
66 echo http://xenbits.xensource.com/linux-2.6.18-xen.hg
67 fi
69 exit 0