qemu: Add tests for new blkdeviotune arguments

The recent commit to add support for block_set_io_throttle parameters
from version 1.7 of qemu did not add any tests - this adds the tests

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan 2014-11-12 10:16:52 -05:00
parent a01eea3020
commit 5c08b12521
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,12 @@
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
/usr/bin/qemu \
-name QEMUGuest1 -S -M pc -m 214 -smp 1 -nographic -nodefaults \
-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
-usb -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-ide0-0-0,cache=off,\
bps=5000,iops=6000,bps_max=10000,iops_max=11000 -device \
ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-drive file=/dev/HostVG/QEMUGuest2,if=none,id=drive-ide0-0-1,cache=off,\
bps_rd=5000,bps_wr=5500,iops_rd=3500,iops_wr=4000,bps_rd_max=6000,\
bps_wr_max=6500,iops_rd_max=7000,iops_wr_max=7500,iops_size=2000 \
-device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3

View File

@ -0,0 +1,51 @@
<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'>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'>
<driver name='qemu' type='qcow2' cache='none'/>
<source dev='/dev/HostVG/QEMUGuest1'/>
<target dev='hda' bus='ide'/>
<iotune>
<total_bytes_sec>5000</total_bytes_sec>
<total_iops_sec>6000</total_iops_sec>
<total_bytes_sec_max>10000</total_bytes_sec_max>
<total_iops_sec_max>11000</total_iops_sec_max>
</iotune>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source dev='/dev/HostVG/QEMUGuest2'/>
<target dev='hdb' bus='ide'/>
<iotune>
<read_bytes_sec>5000</read_bytes_sec>
<write_bytes_sec>5500</write_bytes_sec>
<read_iops_sec>3500</read_iops_sec>
<write_iops_sec>4000</write_iops_sec>
<read_bytes_sec_max>6000</read_bytes_sec_max>
<write_bytes_sec_max>6500</write_bytes_sec_max>
<read_iops_sec_max>7000</read_iops_sec_max>
<write_iops_sec_max>7500</write_iops_sec_max>
<size_iops_sec>2000</size_iops_sec>
</iotune>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<controller type='usb' index='0'/>
<controller type='ide' index='0'/>
<controller type='pci' index='0' model='pci-root'/>
<memballoon model='virtio'/>
</devices>
</domain>

View File

@ -1284,6 +1284,9 @@ mymain(void)
DO_TEST("numad-static-memory-auto-vcpu", NONE);
DO_TEST("blkdeviotune", QEMU_CAPS_NAME, QEMU_CAPS_DEVICE,
QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_IOTUNE);
DO_TEST("blkdeviotune-max", QEMU_CAPS_NAME, QEMU_CAPS_DEVICE,
QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_IOTUNE,
QEMU_CAPS_DRIVE_IOTUNE_MAX);
DO_TEST("multifunction-pci-device",
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,