chiark / gitweb /
wip productisation
authorIan Jackson <ian@anarres>
Thu, 28 Sep 2006 18:24:19 +0000 (19:24 +0100)
committerIan Jackson <ian@anarres>
Thu, 28 Sep 2006 18:24:19 +0000 (19:24 +0100)
15 files changed:
debian/control
xen/README [new file with mode: 0644]
xen/README.config-processing [deleted file]
xen/cleanup
xen/config-vars
xen/default-config
xen/example-config
xen/fixups
xen/fixups-inside
xen/functions [new file with mode: 0644]
xen/on-testbed
xen/readconfig [new file with mode: 0644]
xen/setup
xen/tail-config
xen/with-testbed

index 211ab21e89307ab3fcd3e47c4b52d7a5949eb17d..a98d84488f29fd7dd9efb13bdd1e39774d64e1f0 100644 (file)
@@ -21,4 +21,4 @@ Description: automatic as-installed testing for Debian packages
 
 Package: autopkgtest-xen
 Architecture: all
-Depends: pbuilder, libadns1-bin, chiark-utils-bin
+Depends: pbuilder, libadns1-bin, chiark-utils-bin, iproute
diff --git a/xen/README b/xen/README
new file mode 100644 (file)
index 0000000..2a80a26
--- /dev/null
@@ -0,0 +1,155 @@
+---------- Introduction ----------
+
+The configuration is read as follows:
+ 1. set all variables whose defaults are fixed strings to
+     those built-in default values
+ 2. process the command line arguments
+ 3. read the user configuration file (sourced by bash)
+ 4. process the command line arguments again, so they
+     can easily be made to override the user configuration file
+ 5. calculate the values for variables which haven't been set
+     and whose default values depend on circumstances (including
+     on other variables)
+
+---------- Items which definitely need attention ----------
+
+adt_guests_domain      .<domain-of-host_hostname>
+adt_guest_hostname     <distro>.[<nominum>.]<domain>
+adt_guest_ipaddr       from looking hostname up in the DNS
+       Hostname and IP address for the testbed.
+       If the configuration specifies one of the address and hostname
+       but not the other, the missing information will be found with
+       a DNS lookup.  If neither is specified, adt_guests_domain is
+       used; if it starts with `.' then <distro>.<nominum> is
+       prepended; otherwise just <distro>. is prepended.  NOTE: some
+       effort by the local network administrator to allocate an IP
+       address (and ideally create DNS entries) is essential.  It is
+       not possible to use DHCP for IP address allocation for the
+       testbed.
+
+---------- Items that are likely to need attention ----------
+
+adt_kernel             the booted kernel file /boot/xen*`uname -r`
+       Kernel to boot in the testbed image
+
+adt_ramdisk            <kernel>.initrd.img
+       Initial ramdisk to provide to the testbid image.
+       "none" means do not provide an initial ramdisk.
+
+adt_modules            /lib/modules/`uname -r`
+       Directory with modules to be copied into the testbed.
+
+adt_lvm_vg             the system's LVM volume group if there is only one
+       LVM volume group to create base filesystem image in.
+
+adt_fs_type            ext3
+adt_fs_mkfs_args       <none>
+       Filesystem type and any additional arguments to mkfs.  If
+       _args contains whitespace, it results in multiple arguments;
+       it is not possible to pass whitespace-containing arguments to
+       mkfs.
+
+adt_pbuilder_args      <none>
+       Extra arguments to pass to pbuilder.
+
+---------- Tuning parameters ----------
+
+adt_testbed_ram                256 [Mby]
+       Physical RAM allocated for each testbed instance while
+       creating and running.
+
+adt_freeze_ram         32 [Mby]
+       Physical RAM size for frozen image; we reduce the testbed
+       to this before freezing it and grow it again when we resume
+       it.
+
+adt_fs_size            1G
+       Size of base filesystem image.  Should be big enough to
+       contain all of the software under test and all of its working
+       space, as no running testbed can ever use more than this
+       (despite copy-on-write).
+
+adt_fs_snapsize                500M
+       Space to allocate for copy-on-write snapshot data.  This is
+       the maximum amount of data that a running testbed can use.
+       This value should be less than the adt_fs_size.
+
+adt_fs_cowchunk                8 [Mby]
+       Copy-on-write chunk size.
+
+adt_vm_reduce_retries  10 [seconds]
+       Time to wait for VM to reduce its memory following
+       xm mem-set.
+
+---------- Configuration for advanced uses ----------
+
+adt_config             /etc/autopkgtest/xenlvm_<nominum>_conf
+
+adt_ssh_keytype                dsa
+adt_ssh_privkey                /root/.ssh/id_<ssh_keytype>_<nominum>
+adt_ssh_pubkey         <ssh_privkey>.pub
+adt_ssh_keyident_args  -i <ssh_privkey>
+adt_ssh_keygen_args    -t <ssh_keytype>
+       SSH keypair to use for authentication to the testbed.
+       If the pubkey file and privkey file do not exist and
+       correspond to each other, a new key will be generated.
+       The best combinations of these variables to set are:
+         keytype [& keygen_args] - just change the key type
+         privkey [& keygen_args] - generate/use a different keypair
+         pubkey, keyident_args - use an existing key via agent etc.,
+               privkey is ignored if pubkey and keyident_args
+               are set and pubkey file exists
+
+adt_nominum            adt
+       Namespace prefix for Xen domains, LVM volumes, devmapper
+       devices, entries in /dev, files in /var, and so on.  You may
+       run several instances of the adt virtualisation system with
+       different nominums and they won't interact.  It is best for
+       this to be a legal DNS label (using alphanumerics and hyphens
+       only); normally it when it is used to construct an identifier
+       it will be separated by other parts by underscores `_', so
+       they should be avoided.
+
+
+---------- Items which should not usually need to be changed ----------
+
+adt_host_hostname      `hostname -f`
+adt_host_ipaddr                from looking hostname up in the DNS
+       Hostname and IP address for the host, ie the Xen dom0 system.
+       If the configuration specifies one of the address and hostname
+       but not the other, the missing information will be found with
+       a DNS lookup.  Note that if the host system uses a dynamically
+       allocated DHCP address, things will go wrong when the address
+       changes.
+
+adt_playbase           /var/lib/autopkgtest/xenlvm
+       Base of filesystem playground areas.
+
+adt_play               <playbase>/<nominum>_<distro>
+       Playground area for this particular testbed construction and
+       data.
+
+adt_xmconfig           <play>/xmconfig
+       Xen virtual machine creation configuration for xm create.
+       This file will be (over)written during testbed setup.
+
+adt_lvm_baselv         <nominum>_<distro>_base
+adt_lvm_cowdatalv      <nominum>_<distro>_cowdata
+       LVM volume for base filesystem image, and copy-on-write
+       buffer.  Will be created during testbed setup, destroying any
+       previous volume if necessary.  This is the logical volume name
+       not including /dev/<lvm_vg>.
+
+adt_devmapper_cowdev   <nominum>_<distro>_snap
+       devmapper device for copy-on-write image used by testbed when
+       running.  This is the device name in the devmapper namespace,
+       ie not including /dev/mapper.
+
+adt_fslink_dir         adt-xenlvm
+adt_fslink_name                <nominum>_<distro>_fs
+       Directory in /dev, and filename in that directory, where the
+       scripts put the symlink used to trick Xen into using a
+       different block device on resume than was used for creation.
+
+adt_xmname             <nominum>_<distro>
+       Xen virtual machine name, as passed to xm create.
diff --git a/xen/README.config-processing b/xen/README.config-processing
deleted file mode 100644 (file)
index bf524e8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-1. read config-defaults
-2. process command line args
-3. read user config
-4. process command line args again
-5. process tail-config
index 1b87b3a8c839f11fc2d78db9add8ea31f0b66e15..e822dd7f7297dbdcaae2e12a416dd933d74c377a 100755 (executable)
@@ -2,11 +2,11 @@
 set -e
 . ./config
 
-mkdir -p $play $snap
+mkdir -p $adt_play $snap
 
 try () { "$@" >/dev/null 2>&1 ||:; }
 
-try xm destroy $xmname
-try umount $lvbase
-try dmsetup remove $nsnap
+try xm destroy $adt_xmname
+try umount $adt_lvm_baselv
+try dmsetup remove $adt_devmapper_cowdev
 rm -f $lvfsptr
index 63aee6ea1804b450e9577c485028be175dc52401..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,39 +0,0 @@
-adt_testbed_ram                256 [Mby]
-       Physical RAM allocated for each testbed instance while
-       creating and running.
-
-adt_freeze_ram         32 [Mby]
-       Physical RAM size for frozen image; we reduce the testbed
-       to this before freezing it and grow it again when we resume
-       it.
-
-adt_filesys_size       1G
-       Size of base filesystem image.  Should be big enough to
-       contain all of the software under test and all of its working
-       space, as no running testbed can ever use more than this
-       (despite copy-on-write).
-
-adt_filesys_snapsize   500M
-       Space to allocate for copy-on-write snapshot data.  This is
-       the maximum amount of data that a running testbed can use.
-       This value should be less than the adt_filesys_size.
-
-adt_filesys_cowchunk   8 [Mby]
-       Copy-on-write chunk size.
-
-adt_nominum            adt
-       Namespace prefix for Xen domains, LVM volumes, devmapper
-       devices, entries in /dev, files in /var, and so on.  You may
-       run several instances of the adt virtualisation system with
-       different nominums and they won't interact.
-
-adt_lvm_vg             the system's LVM volume group if there is only one
-       LVM volume group to create base filesystem image in.
-
-adt_kernel             the booted kernel file /boot/xen*`uname -r`
-       Kernel to boot in the testbed image
-
-adt_ramdisk            <kernel>.initrd.img
-       Initial ramdisk to provide to the testbid image.
-       "none" means do not provide an initial ramdisk.
-
index bb414a5518476c6084453e524812479c82745397..c862257b703bdd32bd46ba3430d6c0e00d962114 100644 (file)
@@ -1,7 +1,11 @@
+adt_nominum=${adt_nominum}
 adt_testbed_ram=256
 adt_freeze_ram=32
-adt_filesys_size=1G
-adt_filesys_snapsize=100M
-adt_filesys_cowchunk=8
-
-adt_nominum=${adt_nominum}
+adt_fs_size=1G
+adt_fs_snapsize=100M
+adt_fs_cowchunk=8
+adt_playbase=/var/lib/autopkgtest/xenlvm
+adt_fs_type=ext3
+adt_fs_mkfs_args=''
+adt_vm_reduce_retries=10
+adt_ssh_keytype=dsa
index b95bed0bd2b978c81304640551b4e235390e9050..d14fa574b261fcbcd35dcf6d1d897f1a69d22712 100644 (file)
@@ -1,3 +1,3 @@
-adt_pbuilderopts='--mirror http://mirror.relativity.greenend.org.uk/mirror/ubuntu.early'
+adt_pbuilder_args='--mirror http://mirror.relativity.greenend.org.uk/mirror/ubuntu.early'
 adt_guests_domain=.relativity.greenend.org.uk
 adt_host_hostname=samual.relativity.greenend.org.uk
index 9c9c83dd438171ef0cf9e029481e9aea0c006454..3ab114c0d1d2481665a8c458c6d28709c7a9350c 100755 (executable)
@@ -1,27 +1,34 @@
 #!/bin/sh
 set -ex
+. ${ADT_XENLVM_SHARE:=/usr/share/autopkgtest/xenlvm}/readconfig
 
-dest=$1
-adt_host_hostname=$2
-adt_guest_hostname=$3; shift
+dest=$adt_play/base
 
 echo '---fixups:'
 
-cp     xen-divert-tls-libc     \
-       fixups-inside           \
-        $dest/root/
+cp ${ADT_XENLVM_SHARE}/fixups-inside $dest/root/
 
 mkdir -p $dest/lib/modules
-cp -a /lib/modules/`uname -r`/ $dest/lib/modules/.
+cp -a "${adt_modules}" $dest/lib/modules/.
+
+if ! test -f "${adt_ssh_pubkey}"; then
+       if [ "x${adt_ssh_pubkey}" != "x${adt_ssh_privkey}.priv" ]; then
+               fail "cannot generate keypair automatically because adt_ssh_privkey \`$adt_ssh_privkey' and adt_ssh_pubkey \`$adt_ssh_pubkey' do not match up in the way required by ssh-keygen (<pubkey> must be <privkey>.pub>"
+       fi
+       if test -f "${adt_ssh_privkey}"; then
+               fail "will not overwrite existing private key \`$adt_ssh_privkey' - but where is public key \`$adt_ssh_pubkey' ?"
+       fi
+
+       mkdir -p /root/.ssh
+       ssh-keygen -N '' ${adt_ssh_keygen_args} -f "${adt_ssh_privkey}"
+fi
 
-mkdir -p /root/.ssh
-id_dsa=/root/.ssh/id_dsa_adt
-test -f $id_dsa || ssh-keygen -t dsa -N '' -f $id_dsa
 mkdir -m 02700 -p $dest/root/.ssh
-cp $id_dsa.pub $dest/root/.ssh/authorized_keys
+cp -- "${adt_ssh_pubkey}" $dest/root/.ssh/authorized_keys
 
 cat <<END >$dest/etc/init.d/xenethtoolk
 #!/bin/sh
+# work around checksum offload bug in Xen network bridge driver
 case "$1" in
 start)
        ethtool -K eth0 tx off
@@ -32,7 +39,10 @@ END
 chmod +x $dest/etc/init.d/xenethtoolk
 ln -s ../init.d/xenethtoolk $dest/etc/rc2.d/S21xenethtoolk
 
-chroot $dest root/fixups-inside "$@" "$adt_host_ipaddr" "$adt_guest_ipaddr"
+chroot $dest root/fixups-inside \
+       "$adt_host_hostname" "$adt_guest_hostname" \
+       "$adt_host_ipaddr" "$adt_guest_ipaddr" \
+       "$adt_fs_type"
 
 kh=/etc/ssh/ssh_known_hosts
 test ! -f $kh || cp $kh $kh.new
index 4bee8d8cc8e8c0ee460d8a505c67a4d3be5efced..67fea31ef22fb3bbf12eeba7f7c74ca7da324d9d 100755 (executable)
@@ -5,21 +5,28 @@ adt_host_hostname=$1
 adt_guest_hostname=$2
 adt_host_ipaddr=$3
 adt_guest_ipaddr=$4
+adt_fs_type=$5
 
 echo '(---'
 
 cd /root
 
-perl -i~ -pe 's/ main$/ main universe/ if m/^deb http/' /etc/apt/sources.list
-apt-get update
+if test -f /etc/lsb-release; then
+       . /etc/lsb-release
+       if [ "x$DISTRIB_ID" = xUbuntu ]; then
+               perl -i~ -pe 's/ main$/ main universe/ if m/^deb http/' \
+                       /etc/apt/sources.list
+       fi
+fi
 
-apt-get -y --force-yes install libc6-xen || ./xen-divert-tls-libc do
+apt-get update
+apt-get -y --force-yes install libc6-xen
 
 ldconfig
 
 cat >/etc/fstab <<END
 proc /proc proc defaults 0 0
-/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
+/dev/hda1 / $adt_fs_type defaults,errors=remount-ro 0 1
 END
 
 mkdir -p /etc/network
diff --git a/xen/functions b/xen/functions
new file mode 100644 (file)
index 0000000..e69de29
index 59671504262dee7f9cdf730b9ebce20d9e642019..d4bce670e0af6ee9b944c0fdc2c2a0fc5c44c870 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 set -e
 . ./config
-ssh -i $sshkey $adt_guest_ipaddr "$@"
+ssh -i $adt_sshkey $adt_guest_ipaddr "$@"
diff --git a/xen/readconfig b/xen/readconfig
new file mode 100644 (file)
index 0000000..5638cc9
--- /dev/null
@@ -0,0 +1,56 @@
+# This bash script is sourced by the various tools to set the
+# adt_... variables.
+
+fail () {
+       echo >&2 "xenlvm: ${0##*/}: error: $*"
+       exit 16
+}
+
+cmdline_args () {
+       while [ $# -gt 0 ]; do
+               arg="$1"
+               case "$arg" in
+               --*=*)
+                       value="${arg#*=}"
+
+                       var=${arg%%=*}
+                       var=${var#--}
+                       case "$var" in
+                       *-*)    var="$(printf "%s" "$var" | tr -- - _)" ;;
+                       esac
+                       var=${var#adt_}
+
+                       case $var in
+                       *) ;; # @@varlist@@
+                       *) fail "unknown configuration variable \`$var'" ;;
+                       esac
+
+                       eval "$var=\"\$value\""
+                       shift ;;
+
+               --)     break ;;
+               -*)     fail "unknown option \`$arg'" ;;
+               *)      shift; break ;;
+               esac
+       done
+       test $# = 0 || fail "non-option arguments not allowed"
+}
+
+. $ADT_XENLVM_SHARE/config-default
+cmdline_args
+. ${adt_config}
+
+. 
+
+
+lvm_baselv_namerhs=${adt_vg}/${adt_lvm_baselv}
+lvm_baselv_namepath=/dev/${adt_lvbaserhs}
+
+lvm_cowdata_namerhs:=${adt_vg}/${adt_lvm_cowdatalv}
+adt_cowdata_namepath:=/dev/${lvm_cowdata_namerhs}
+
+lvm_snapdev=/dev/mapper/${adt_devmapper_cowdev}
+
+lvm_fslink_ptrrhs=${adt_fslink_dir}/${adt_fslink_name}
+lvm_fslink_dirpath=/dev/${adt_fslink_dir}
+lvm_fslink_ptr=/dev/${lvm_fslink_dir}/${adt_fslink_name}
index 786e62f229f510ca6d54cad917b226f89299ad8f..83e5ab4f7e996d9d4364eb7f13b478f543ac8665 100755 (executable)
--- a/xen/setup
+++ b/xen/setup
@@ -1,39 +1,36 @@
 #!/bin/bash
 set -e
-. ./config
-./cleanup
-lvchange -a n $lvcowdata ||:
-lvremove $lvbase ||:
-lvremove $lvcowdata ||:
+. ${ADT_XENLVM_SHARE:=/usr/share/autopkgtest/xenlvm}/readconfig
 
-lvcreate -L $adt_filesys_size -n $lvbase $adt_lvm_vg
-lvcreate -L $adt_filesys_snapsize -n $ncowdata $adt_lvm_vg
-#dd if=/dev/zero of=$lvbase
-mkfs -t ext3 $lvbase
+$ADT_XENLVM_SHARE/cleanup
+lvchange -a n $lvm_cowdata_namepath ||:
+lvremove $lvm_baselv_namepath ||:
+lvremove $lvm_cowdata_namepath ||:
 
-mkdir -p $play/base
-mount $lvbase $play/base
+lvcreate -L $adt_fs_size -n $adt_lvm_baselv $adt_lvm_vg
+lvcreate -L $adt_fs_snapsize -n $adt_lvm_cowdatalv $adt_lvm_vg
+dd if=/dev/zero of=$lvm_baselv_namepath
+mkfs -t $adt_fs_type $adt_mkfs_args $lvm_baselv_namepath
 
-#--basetgz $play/base.tgz --buildplace
+mkdir -p $adt_play/base
+mount $adt_lvm_baselv $adt_play/base
 
-pbuilder create --configfile ./pbuilderrc --distribution $distro       \
-       --no-targz --buildplace $play/base                              \
-       $pbuilderopts   --debootstrapopts --variant=''
+pbuilder create --configfile /dev/null --distribution $distro  \
+       --no-targz --buildplace $adt_play/base                  \
+       $adt_pbuilder_args   --debootstrapopts --variant=''
 
-./fixups $play/base $adt_host_hostname $adt_guest_hostname
+$ADT_XENLVM_SHARE/fixups "$@"
 
 echo "
 --- writing $adt_xmconfig ---
 "
 
-adt_host_ipaddr=`adnshost -t a +Do +Dt +Dc $adt_host_hostname`
-
 cat <<END >$adt_xmconfig
 kernel = "$kernel"
 memory = $adt_testbed_ram
 root = "/dev/hda1"
 extra = "ro console=tty0"
-disk = [ "phy:$lvfsptrrhs,hda1,w" ]
+disk = [ "phy:$lvm_fslink_ptrrhs,hda1,w" ]
 vif = [ "bridge=none,mac=00:16:3e:7c:aa:7f,ip=$adt_guest_ipaddr,script=/etc/xen/scripts/vif-route-adt" ]
 on_crash = "preserve"
 on_reboot = "preserve"
@@ -46,31 +43,31 @@ ramdisk = "$ramdisk"
 END
 fi
 
-umount $lvbase
+umount $adt_lvm_baselv
 
-mkdir -p /dev/${pfx}_fs
-ln -sf ../$lvbaserhs $lvfsptr
-xm create $adt_xmconfig name=$xmname
+mkdir -p /dev/${lvm_fslink_dirpath}
+ln -sf ../$lvm_baselv_namerhs ${lvm_fslink_ptr}
+xm create $adt_xmconfig name=$adt_xmname
 retries=10
 
 while true; do
        if ping -c 1 $adt_guest_ipaddr && ./on-testbed id; then break; fi
        if [ $retries -le 0 ]; then 
                echo >&2 'no response from guest'
-               xm console $xmname
+               xm console $adt_xmname
                exit 1
        fi
        retries=$(($retries-1))
        sleep 2
 done
 
-xm mem-set $xmname $adt_freeze_ram
-retries=10
+xm mem-set $adt_xmname $adt_freeze_ram
+retries=$adt_vm_reduce_retries
 while sleep 1; do
-  if xm mem-max $xmname $adt_freeze_ram; then break; fi
+  if xm mem-max $adt_xmname $adt_freeze_ram; then break; fi
   if [ $retries -le 0 ]; then echo >&2 'cannot reduce memory'; exit 1; fi
   retries=$(($retries-1))
 done
 
-xm save $xmname $play/xen-save
-rm $lvfsptr
+xm save $adt_xmname $adt_play/xen-save
+rm ${lvm_fslink_ptr}
index 22494f7b49f4d546b9feca1deb03489a2784197c..996c857e2c999f6ad5815be8f1da91c9b11b95ea 100644 (file)
@@ -33,6 +33,11 @@ none)        echo "ramdisk \`none' specified, using static kernel"
 *)     ;;
 esac
 
+case "$adt_modules" in
+'')    /lib/modules/`uname -r` ;;
+*)     ;;
+esac
+
 case "$adt_distro" in
 '')
        echo "considering which distro to use ..."
@@ -85,27 +90,25 @@ ipaddr_from_hostname () {
 ipaddr_from_hostname guest
 ipaddr_from_hostname host
 
+: ${adt_config:=/etc/autopkgtest/xenlvm_${adt_nominum}_config}
+
 # SSH
-: ${adt_sshkey:=/root/.ssh/id_dsa_${adt_nominum}}
+: ${adt_ssh_privkey:=/root/.ssh/id_${adt_ssh_keytype}_${adt_nominum}}
+: ${adt_ssh_pubkey:=${adt_ssh_privkey}.pub}
+: ${adt_ssh_keyident_args:=-i ${adt_ssh_privkey}}
+: ${adt_ssh_keygen_args:=-t ${adt_ssh_keytype}}
 
 # Xen
 : ${adt_xmname:=${adt_nominum}_${adt_distro}}
 
 # In-host-file-system playground
-: ${adt_play:=${adt_playbase}/${adt_distro}}
+: ${adt_play:=${adt_playbase}/${adt_nominum}_${adt_distro}}
 : ${adt_xmconfig:=${adt_play}/xmconfig}
 
 # LVM
-: ${adt_nbase:=${adt_nominum}_${adt_distro}_base}
-: ${adt_lvbaserhs:=${adt_vg}/${adt_nbase}}
-: ${adt_lvbase:=/dev/${adt_lvbaserhs}}
-
-: ${adt_nsnap:=${adt_nominum}_${adt_distro}_snap}
-: ${adt_lvsnap:=/dev/mapper/${adt_nsnap}}
-
-: ${adt_ncowdata:=${adt_nominum}_${adt_distro}_cowdata}
-: ${adt_lvcowdatarhs:=${adt_vg}/${adt_ncowdata}}
-: ${adt_lvcowdata:=/dev/${adt_lvcowdatarhs}}
+: ${adt_lvm_baselv:=${adt_nominum}_${adt_distro}_base}
+: ${adt_lvm_cowdatalv:=${adt_nominum}_${adt_distro}_cowdata}
+: ${adt_devmapper_cowdev:=${adt_nominum}_${adt_distro}_snap}
 
-: ${adt_lvfsptrrhs:=${adt_nominum}_fs/${adt_distro}}
-: ${adt_lvfsptr:=/dev/${adt_lvfsptrrhs}}
+: ${adt_fslink_dir:=adt-xenlvm}
+: ${adt_fslink_name:=${adt_nominum}_${adt_distro}_fs}
index f1212c8473e4a6785204d626b04337e4944fd9bb..d102f8b089bed48359fb065dc21fcf58a3bf8730 100755 (executable)
@@ -8,18 +8,18 @@ trap 'exit 127' 0
 
 modprobe dm-snapshot ||:
 
-#dd if=/dev/zero of=/dev/$lvcowdata bs=512 count=$adt_filesys_cowchunk status=noxfer
+#dd if=/dev/zero of=/dev/$lvm_cowdata_namepath bs=512 count=$adt_fs_cowchunk status=noxfer
 
-bdsize=$(blockdev --getsize $lvbase)
-dmsetup create $nsnap <<END
-0 $bdsize snapshot $lvbase $lvcowdata n $adt_filesys_cowchunk
+bdsize=$(blockdev --getsize $adt_lvm_baselv)
+dmsetup create $adt_devmapper_cowdev <<END
+0 $bdsize snapshot $adt_lvm_baselv $lvm_cowdata_namepath n $adt_fs_cowchunk
 END
 
-mkdir -p /dev/${pfx}_fs
-ln -s $lvsnap $lvfsptr
+mkdir -p $lvm_fslink_dirpath
+ln -s $lvm_snapdev $lvm_fslink_ptr
 
-xm restore $play/xen-save
-xm mem-set $xmname $adt_testbed_ram
+xm restore $adt_play/xen-save
+xm mem-set $adt_xmname $adt_testbed_ram
 udevsettle
 
 set +e
@@ -27,8 +27,8 @@ set +e
 rc=$?
 set -e
 
-xm destroy $xmname
-dmsetup remove $nsnap
+xm destroy $adt_xmname
+dmsetup remove $adt_devmapper_cowdev
 
 trap '' 0
 exit $rc