diff options
author | iap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk> | 2003-02-20 16:02:43 +0000 |
---|---|---|
committer | iap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk> | 2003-02-20 16:02:43 +0000 |
commit | f0568abaa30c92d2e92c5b705d34b29dc55cd987 (patch) | |
tree | 3c311ce9d1154951d2fb400533005daba56bd247 /tools | |
parent | 10335d97eb98cff1df1cf1d1889e58898d138210 (diff) | |
download | xen-f0568abaa30c92d2e92c5b705d34b29dc55cd987.tar.gz xen-f0568abaa30c92d2e92c5b705d34b29dc55cd987.tar.bz2 xen-f0568abaa30c92d2e92c5b705d34b29dc55cd987.zip |
bitkeeper revision 1.76.1.1 (3e54fc23zcQZlR65KsPYjjBI9M-6Hg)
modifications to newdom scripts. Example invocations:
newdom <size> <image> <ip> <root details>
really ./newdom 16000 ../../../xenolinux-2.4.16-kdb/arch/xeno/boot/image 128.232.35.xxx root=/dev/nfs nfsroot=/usr/groups/srgboot/hhh/roots/root1
really ./newdom 16000 ../../../xenolinux-2.4.16-kdb/arch/xeno/boot/image 128.232.35.xxx root=/dev/xhdaNNN
[fill in hhh, xxx and NNN as appropriate]
Diffstat (limited to 'tools')
-rw-r--r-- | tools/domain_builder/dom_builder.c | 7 | ||||
-rw-r--r-- | tools/domain_builder/newdom | 27 | ||||
-rwxr-xr-x[-rw-r--r--] | tools/domain_builder/vifinit | 0 |
3 files changed, 25 insertions, 9 deletions
diff --git a/tools/domain_builder/dom_builder.c b/tools/domain_builder/dom_builder.c index d2df002a67..18bc643734 100644 --- a/tools/domain_builder/dom_builder.c +++ b/tools/domain_builder/dom_builder.c @@ -474,7 +474,10 @@ int main(int argc, char **argv) if(launch_domain(meminfo) != 0) ret = -1; - free(meminfo); + out: - return ret; + if( ret >= 0 ) + return meminfo->domain; + else + return ret; } diff --git a/tools/domain_builder/newdom b/tools/domain_builder/newdom index 979661ec26..3b0612638c 100644 --- a/tools/domain_builder/newdom +++ b/tools/domain_builder/newdom @@ -1,17 +1,30 @@ #!/bin/sh +# newdom <size> <image> <ip> <root details> +# newdom 262144 ../../../xenolinux-2.4.16-kdb/arch/xeno/boot/image 128.232.35.240 root=/dev/nfs nfsroot=/usr/groups/srgboot/xxx/roots/root0 +# newdom 262144 ../../../xenolinux-2.4.16-kdb/arch/xeno/boot/image 128.232.35.240 root=/dev/xhda7 + + VIFINIT=./vifinit DOM_BUILDER=./domain_builder -DOM=$2 +SIZE=${1:?"size missing"} +IMAGE=${2:?"image missing"} +IP=${3:?"IP missing"} + +shift; shift; shift + +echo ARGS $* + +$DOM_BUILDER $SIZE $IMAGE 1 ro ip=$IP:128.232.32.20:128.232.32.1:255.255.240.0::eth0:off $* +DOM=$? + +echo DOM= $DOM -ADDR=`/sbin/ifconfig eth0 | grep inet.addr | sed -e 's/.*inet addr:\([0-9.]*\) .*/\1/'` +VIF=`cat /proc/xeno/dom$DOM/vif` -LO=`echo $ADDR | sed -e 's/[0-9]\+\.[0-9]\+\.[0-9]\+\.\([0-9]\+\)/\1/'` -HI=`echo $ADDR | sed -e 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\)\.[0-9]\+/\1/'` +echo VIF= $VIF -NEWADDR=$HI.$[LO+DOM] +$VIFINIT $VIF $IP -$VIFINIT $DOM $NEWADDR -$DOM_BUILDER 16000 $1 1 diff --git a/tools/domain_builder/vifinit b/tools/domain_builder/vifinit index 58b50eaab0..58b50eaab0 100644..100755 --- a/tools/domain_builder/vifinit +++ b/tools/domain_builder/vifinit |