first="a"
fi
fi
+
+ local prefix_chars="$(eval echo {a..z})"
+ prefix_chars="${prefix_chars// /}" # Remove spaces
+ # Need prefix in a variable because it is initially empty.
+ local prefix=""
local chars="$(eval echo {${first}..z})"
chars="${chars// /}" # Remove spaces
local p c
for p in $(seq 1 $paths) ; do
for c in $(seq 1 $SHAREDDISK_COUNT) ; do
- local dev="${chars:0:1}"
- [ -n "$dev" ] || die "Too many shared disks! The function shared_disk_template needs to be hacked to allow more shared disks..."
+ if [ -z "$chars" -a -n "$prefix_chars" ] ; then
+ prefix="${prefix_chars:0:1}"
+ prefix_chars="${prefix_chars:1}"
+ chars="$(eval echo {a..z})"
+ chars="${chars// /}" # Remove spaces
+ fi
+ [ -n "$chars" ] || die "Too many shared disks! The function shared_disk_template needs to be hacked to allow more shared disks..."
+ local dev="${prefix}${chars:0:1}"
cat <<EOF
<disk type='file' device='disk'>
<driver name='qemu' cache='@@SHARED_DISK_CACHE@@'/>