#!/bin/bash VM=`xm domid tpath1.para` /usr/sbin/xm block-list $VM | ( clean=0 read header read skipline # Skip one line - this is the block for the virtual drive. # read another line here, if we should skip it. # Now read in the rest. # Vdev BE handle state evtch ringref BEpath while read vdev junk do clean=1 echo Performing /usr/sbin/xm block-detach $VM $vdev /usr/sbin/xm block-detach $VM $vdev done if [ "$clean" -eq 0 ] ; then echo "Nothing to clean!" fi )