ia64/xen-unstable

view buildconfigs/create_config.sh @ 11753:bf0deb09facd

[XEND] Fix pygrub when run server-side on a domain with blktap disks.

For some slightly-crazy reason the blktap patches changed the name
of the SEXPR block containing the disk definition 'vbd' to 'tap', even
though merely changing the 'uname' fragement was sufficient. eg

(vbd (backend 0) (dev hda:disk) (uname file:/xen/rhel4x86_64.img)
(mode w) )

changes to

(tap (backend 0) (dev hda:disk) (uname tap:aio:/xen/rhel4x86_64.img)
(mode w) )

If you create a domain with xm, then xm runs pygrub client side which
works fine. If you create a domain by feeding a block of SEXPR to Xend
over its network port, then pygrub is run server side. The code in
XenD which decides which disk to run pygrub against only looks for
'device/vbd' in the SEXPR so fails to see any blktap disks.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
author kfraser@localhost.localdomain
date Thu Oct 05 16:14:50 2006 +0100 (2006-10-05)
parents 84ff152efb0a
children 20dba1b883f2
line source
1 #!/bin/sh
2 set -e
5 # Parse arguments
6 #
7 if [ $# -lt 1 -o $# -gt 4 ]; then
8 echo "Usage: $0 config-file EXTRAVERSION XEN_TARGET_ARCH XEN_SYSTYPE"
9 exit 1
10 fi
12 config_file=$1
13 extraversion=$2
14 target_arch=$3
15 systype=$4
18 # Start with initial config skeleton file, if any.
19 # Derive from linux-defconfig_xen_x86_32 otherwise.
20 #
21 skeleton=buildconfigs/linux-defconfig_${extraversion}_${target_arch}${systype}
22 [ -r $skeleton ] || skeleton=buildconfigs/linux-defconfig_xen_x86_32
23 cp $skeleton $config_file
26 # Update
27 #
28 filter_template="s/^#\{0,1\} *\(CONFIG[^= ]*\).*/\/^#\\\{0,1\\\} *\1[= ].*\/d/p"
29 config_dirs="buildconfigs/conf.linux buildconfigs/conf.linux-${target_arch} buildconfigs/conf.linux-${extraversion} buildconfigs/conf.linux-${target_arch}-${extraversion}"
31 for config_dir in $config_dirs
32 do
33 if [ -d $config_dir ]; then
34 # processing is done in alphanumeric order
35 find $config_dir -type f | sort | while read update
36 do
37 # create the filter rules in a temp file
38 filter_rules=`mktemp -t xenupdateconf.XXXXXXXXXX`
39 sed -n "${filter_template}" < $update > $filter_rules
41 # filter the config file in place, removing any options that
42 # will be updated.
43 sed -f $filter_rules -i $config_file
44 cat $update >> $config_file
46 # clean up
47 rm -f $filter_rules
48 done
49 fi
50 done