#!/bin/sh
# Exercise a bug whereby defining a valid domain could kill libvirtd.
# The bug can also be exercised with a simple define/dumpxml pair to virsh.
if test "$VERBOSE" = yes; then
set -x
virsh --version
fi
test -z "$srcdir" && srcdir=$(pwd)
test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/..
. "$srcdir/test-lib.sh"
fail=0
# Domain definition from Cole Robinson.
cat <<\EOF > D.xml || fail=1
D
aaa3ae22-fed2-bfbd-ac02-3bea3bcfad82
262144
262144
1
hvm
destroy
restart
destroy
/usr/bin/qemu-kvm
EOF
url=test:///default
virsh --connect "$url" 'define D.xml; dumpxml D' > out 2>&1 || fail=1
cat > exp <