2 # Exercise a bug whereby defining a valid domain could kill libvirtd.
3 # The bug can also be exercised with a simple define/dumpxml pair to virsh.
5 .
"$(dirname $0)/test-lib.sh"
7 if test "$VERBOSE" = yes; then
9 $abs_top_builddir/tools
/virsh
--version
14 # Domain definition from Cole Robinson.
15 cat <<\EOF
> D.xml || fail
=1
18 <uuid
>aaa3ae22-fed2-bfbd-ac02-3bea3bcfad82
</uuid
>
19 <memory unit
='KiB'>262144</memory
>
20 <currentMemory unit
='KiB'>262144</currentMemory
>
21 <vcpu placement
='static'>1</vcpu
>
23 <type arch
='i686' machine
='pc'>hvm
</type>
30 <on_poweroff
>destroy
</on_poweroff
>
31 <on_reboot
>restart
</on_reboot
>
32 <on_crash
>destroy
</on_crash
>
34 <emulator
>/usr
/bin
/qemu-system-i686
</emulator
>
35 <controller
type='usb' index
='0'/>
55 <target
type='serial' port
='0'/>
57 <sound model
='pcspk'/>
58 <sound model
='es1370'/>
59 <memballoon model
='virtio'/>
65 $abs_top_builddir/tools
/virsh
--connect "$url" 'define D.xml; dumpxml D' > out
2>&1 || fail
=1
67 cat > exp
<<EOF || fail=1
68 Domain D defined from D.xml
74 compare exp out || fail
=1