set -x
sleep 1
(echo 'dd if=/dev/urandom of=testfile count=100'; sleep 1) |nc -U /tmp/vm
virsh snapshot-create-as vm s1 --memspec snapshot=external,file=/tmp/mem.s1 --diskspec vda,snapshot=external,file=/tmp/vda.s1
(echo 'dd if=/dev/urandom of=testfile count=100'; sleep 1) |nc -U /tmp/vm
virsh snapshot-create-as vm s2 --memspec snapshot=external,file=/tmp/mem.s2 --diskspec vda,snapshot=external,file=/tmp/vda.s2
(echo 'dd if=/dev/urandom of=testfile count=100'; sleep 1) |nc -U /tmp/vm
virsh snapshot-create-as vm s3 --memspec snapshot=external,file=/tmp/mem.s3 --diskspec vda,snapshot=external,file=/tmp/vda.s3
(echo 'dd if=/dev/urandom of=testfile count=100'; sleep 1) |nc -U /tmp/vm
virsh snapshot-revert vm s1
virsh snapshot-create-as vm s4 --memspec snapshot=external,file=/tmp/mem.s4 --diskspec vda,snapshot=external,file=/tmp/vda.s4
(echo 'dd if=/dev/urandom of=testfile count=100'; sleep 1) |nc -U /tmp/vm
virsh snapshot-create-as vm s5 --memspec snapshot=external,file=/tmp/mem.s5 --diskspec vda,snapshot=external,file=/tmp/vda.s5
(echo 'dd if=/dev/urandom of=testfile count=100'; sleep 1) |nc -U /tmp/vm
virsh snapshot-delete vm s5
(echo 'dd if=/dev/urandom of=testfile count=100'; sleep 1) |nc -U /tmp/vm
virsh snapshot-delete vm s4
(echo 'dd if=/dev/urandom of=testfile count=100'; sleep 1) |nc -U /tmp/vm
virsh snapshot-delete vm s3
(echo 'dd if=/dev/urandom of=testfile count=100'; sleep 1) |nc -U /tmp/vm
virsh snapshot-delete vm s2
(echo 'dd if=/dev/urandom of=testfile count=100'; sleep 1) |nc -U /tmp/vm
virsh snapshot-delete vm s1
