Add test for virtio serial port assignment

Add a test to demonstrate the effect of automatic virtio-serial
address assignment.
This commit is contained in:
Ján Tomko 2014-05-29 15:16:47 +02:00
parent f51fbdd19d
commit 8945d6a805
3 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,20 @@
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults \
-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c \
-device virtio-serial-pci,id=virtio-serial0,max_ports=4,vectors=4,bus=pci.0\
,addr=0x3 -device virtio-serial-pci,id=virtio-serial1,bus=pci.0,addr=0xa \
-usb -hda /dev/HostVG/QEMUGuest1 \
-chardev pty,id=charchannel0 -device virtserialport,bus=virtio-serial0.0,nr=1,\
chardev=charchannel0,id=channel0,name=org.linux-kvm.port.0 \
-chardev pty,id=charchannel1 -device virtserialport,bus=virtio-serial0.2,nr=1,\
chardev=charchannel1,id=channel1,name=org.linux-kvm.port.foo \
-chardev pty,id=charchannel2 -device virtserialport,bus=virtio-serial0.0,nr=1,\
chardev=charchannel2,id=channel2,name=org.linux-kvm.port.bar \
-chardev pty,id=charchannel3 -device virtserialport,bus=virtio-serial0.0,nr=2,\
chardev=charchannel3,id=channel3,name=org.linux-kvm.port.wizz \
-chardev pty,id=charchannel4 -device virtserialport,bus=virtio-serial0.0,nr=3,\
chardev=charchannel4,id=channel4,name=org.linux-kvm.port.ooh \
-chardev pty,id=charchannel5 -device virtserialport,bus=virtio-serial0.0,nr=4,\
chardev=charchannel5,id=channel5,name=org.linux-kvm.port.lla \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4

View File

@ -0,0 +1,50 @@
<domain type='qemu'>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219100</memory>
<currentMemory unit='KiB'>219100</currentMemory>
<vcpu placement='static' cpuset='1-4,8-20,525'>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu</emulator>
<disk type='block' device='disk'>
<source dev='/dev/HostVG/QEMUGuest1'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'/>
<controller type='ide' index='0'/>
<controller type='virtio-serial' index='0' ports='4' vectors='4'/>
<controller type='virtio-serial' index='1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
</controller>
<channel type='pty'>
<target type='virtio' name='org.linux-kvm.port.0'/>
</channel>
<channel type='pty'>
<target type='virtio' name='org.linux-kvm.port.foo'/>
<address type='virtio-serial' controller='0' bus='2'/>
</channel>
<channel type='pty'>
<target type='virtio' name='org.linux-kvm.port.bar'/>
<address type='virtio-serial' controller='0' port='1'/>
</channel>
<channel type='pty'>
<target type='virtio' name='org.linux-kvm.port.wizz'/>
</channel>
<channel type='pty'>
<target type='virtio' name='org.linux-kvm.port.ooh'/>
</channel>
<channel type='pty'>
<target type='virtio' name='org.linux-kvm.port.lla'/>
</channel>
<memballoon model='virtio'/>
</devices>
</domain>

View File

@ -1072,6 +1072,8 @@ mymain(void)
QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG);
DO_TEST("channel-virtio-auto",
QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG);
DO_TEST("channel-virtio-autoassign",
QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG);
DO_TEST("console-virtio",
QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG);
DO_TEST("console-virtio-many",