if [ -z $1 ]; then
if [ -f /var/lib/libvirt/images/$1.img ]; then
ls -l /var/lib/libvirt/images/$1.img
echo -n "remove $1 instance? "
read x
if [ $x != "y" ]; then
echo aborting
exit
fi
else
echo -n "create $1 instance? "
read x
if [ $x != "y" ]; then
echo aborting
exit
fi
fi
mkdir -p /var/lib/libvirt/images
virt-install \
--connect qemu:///system \
-n $1 \
-r 512 \
--vcpus=2 \
--disk path=/var/lib/libvirt/images/$1.img,size=3 \
--vnc \
--pxe \
--noautoconsole \
--os-type linux \
--os-variant debiansqueeze \
--accelerate \
--network=bridge:br0 \
--hvm