Bug 1341103
| Summary: | No limit for iothrottling burst_length | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Gu Nini <ngu> |
| Component: | qemu-kvm-rhev | Assignee: | Stefan Hajnoczi <stefanha> |
| Status: | CLOSED ERRATA | QA Contact: | CongLi <coli> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 7.3 | CC: | aliang, chayang, coli, juzhang, knoel, michen, mrezanin, pingl, stefanha, virt-maint |
| Target Milestone: | rc | Keywords: | TestOnly |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | qemu-kvm-rhev-2.12.0-1.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-11-01 11:01:10 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Values from the command-line and monitor commands lack strict type-checking. The burst_length field is an unsigned int but the parsing functions deal with int64_t or uint64_t. The overflow is silent. This is a general limitation in QEMU. Other commands are probably affected too. A real solution must address this uniformly. Luckily the severity of this issue is fairly low. Deferring the bug. Bumping to RHEL 7.6. retest with qemu-kvm-rhev-2.12.0-12.el7, the negative value is not allowed to set.
version:
qemu: qemu-kvm-rhev-2.12.0-12.el7
host/guest kernel: kernel-3.10.0-940.el7.x86_64
steps:
1. boot guest.
2. check disk's paramaters with qmp.
{"QMP": {"version": {"qemu": {"micro": 0, "minor": 12, "major": 2}, "package": "qemu-kvm-rhev-2.12.0-12.el7"}, "capabilities": []}}
{"execute":"qmp_capabilities"}
{"return": {}}
{ "execute": "query-block"}
{"return": [{"io-status": "ok", "device": "drive_image1", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 21474836480, "filename": "/home/rhel76-64-virtio-scsi.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": 4557111296, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "refcount-bits": 16, "corrupt": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "#block144", "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "cache": {"no-flush": false, "direct": true, "writeback": true}, "file": "/home/rhel76-64-virtio-scsi.qcow2", "encryption_key_missing": false}, "qdev": "image1", "type": "unknown"}, {"io-status": "ok", "device": "drive_image2", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "bps_max_length": 10, "image": {"virtual-size": 10737418240, "filename": "/home/disk1", "cluster-size": 65536, "format": "qcow2", "actual-size": 200704, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "refcount-bits": 16, "corrupt": false}}, "dirty-flag": false}, "iops_wr": 0, "group": "drive_image2", "ro": false, "node-name": "#block359", "backing_file_depth": 0, "drv": "qcow2", "bps_max": 512000, "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 102400, "bps_rd": 0, "cache": {"no-flush": false, "direct": true, "writeback": true}, "file": "/home/disk1", "encryption_key_missing": false}, "qdev": "image2", "type": "unknown"}]}
3. try to set the negative value.
{ "execute": "block_set_io_throttle", "arguments": { "device": "drive_image2","bps": 102400,"bps_rd": 0,"bps_wr": 0,"iops": 0,"iops_rd": 0,"iops_wr": 0,"bps_max":102400,"bps_max_length":-1}}
{"error": {"class": "GenericError", "desc": "burst length too high for this burst rate"}}
{ "execute": "block_set_io_throttle", "arguments": { "device": "drive_image2","bps": 102400,"bps_rd": 0,"bps_wr": 0,"iops": 0,"iops_rd": 0,"iops_wr": 0,"bps_max":102400,"bps_max_length":10000000000}}
{"error": {"class": "GenericError", "desc": "burst length too high for this burst rate"}}
{ "execute": "block_set_io_throttle", "arguments": { "device": "drive_image2","bps": 102400,"bps_rd": 0,"bps_wr": 0,"iops": 0,"iops_rd": 0,"iops_wr": 0,"bps_max":102400,"bps_max_length":111111111111111111111111}}
{"error": {"class": "GenericError", "desc": "Invalid parameter type for 'bps_max_length', expected: integer"}}
{ "execute": "block_set_io_throttle", "arguments": { "device": "drive_image2","bps": 102400,"bps_rd": 0,"bps_wr": 0,"iops": 0,"iops_rd": 0,"iops_wr": 0,"bps_max":102400,"bps_max_length":&*}}
{"error": {"class": "GenericError", "desc": "Invalid JSON syntax"}}
{"error": {"class": "GenericError", "desc": "Invalid JSON syntax"}}
{"error": {"class": "GenericError", "desc": "JSON parse error, expecting value"}}
{"error": {"class": "GenericError", "desc": "JSON parse error, expecting value"}}
{ "execute": "block_set_io_throttle", "arguments": { "device": "drive_image2","bps": 102400,"bps_rd": 0,"bps_wr": 0,"iops": 0,"iops_rd": 0,"iops_wr": 0,"bps_max":102400,"bps_max_length":0.2}}
{"error": {"class": "GenericError", "desc": "Invalid parameter type for 'bps_max_length', expected: integer"}}
{ "execute": "block_set_io_throttle", "arguments": { "device": "drive_image2","bps": 102400,"bps_rd": 0,"bps_wr": 0,"iops": 0,"iops_rd": 0,"iops_wr": 0,"bps_max":102400,"bps_max_length":0}}
{"error": {"class": "GenericError", "desc": "the burst length cannot be 0"}}
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:3443 |
Description of problem: The value of iothrottling burst_length can be negatives or larger than 1000000000, but checked with a wrong value in qmp Version-Release number of selected component (if applicable): kernel: 3.10.0-406.el7.x86_64 qemu-kvm-rhev: qemu-kvm-rhev-2.6.0-4.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. Start a guest with iothrottling parameter burst_length on a data disk, and set such as throttling.bps-total-max-length: /usr/libexec/qemu-kvm -name rhel7.3 -enable-kvm -m 4G -smp 4 -uuid ae361e8d-288b-4e70-8783-bda0d450ce38 -nodefconfig --nodefaults -boot order=cd,menu=on -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=03 -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,format=qcow2,file=/home/rhel7.3 -device scsi-hd,id=image1,drive=drive_image1,bootindex=0 -drive file=/home/kvm_autotest_root/iso/linux/RHEL-7.2-20151030.0-Server-x86_64-dvd1.iso,media=cdrom,id=cdrom,if=none -device ide-drive,drive=cdrom,bootindex=1 -vnc 0.0.0.0:14 -monitor stdio -netdev tap,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:52:5a:30:2e:61,bus=pci.0,addr=0x7 -drive id=drive_image2,if=none,cache=none,snapshot=off,aio=native,format=qcow2,file=/home/disk1,bps=102400,bps_max=512000,throttling.bps-total-max-length=10 -device scsi-hd,id=image2,drive=drive_image2 -chardev socket,id=qmpmonitor1,path=/tmp/monitor1,server,nowait -mon chardev=qmpmonitor1,mode=control -vga cirrus 2. Set the burst_length to be a negative value in qmp and check it with qmp cmd '{ "execute": "query-block"}': nc -U /tmp/monitor1 {"QMP": {"version": {"qemu": {"micro": 0, "minor": 6, "major": 2}, "package": " (qemu-kvm-rhev-2.6.0-4.el7)"}, "capabilities": []}} {"execute":"qmp_capabilities"} {"return": {}} { "execute": "block_set_io_throttle", "arguments": { "device": "drive_image2","bps": 102400,"bps_rd": 0,"bps_wr": 0,"iops": 0,"iops_rd": 0,"iops_wr": 0,"bps_max":102400,"bps_max_length":-10}} { "execute": "query-block"} {"return": [{"io-status": "ok", "device": "drive_image1", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 21474836480, "filename": "/home/rhel7.3", "cluster-size": 65536, "format": "qcow2", "actual-size": 1461977088, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "refcount-bits": 16, "corrupt": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "#block106", "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "cache": {"no-flush": false, "direct": true, "writeback": true}, "file": "/home/rhel7.3", "encryption_key_missing": false}, "type": "unknown"}, {"io-status": "ok", "device": "cdrom", "locked": true, "removable": true, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 4043309056, "filename": "/home/kvm_autotest_root/iso/linux/RHEL-7.2-20151030.0-Server-x86_64-dvd1.iso", "format": "raw", "actual-size": 4051255296, "dirty-flag": false}, "iops_wr": 0, "ro": true, "node-name": "#block343", "backing_file_depth": 0, "drv": "raw", "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "cache": {"no-flush": false, "direct": false, "writeback": true}, "file": "/home/kvm_autotest_root/iso/linux/RHEL-7.2-20151030.0-Server-x86_64-dvd1.iso", "encryption_key_missing": false}, "tray_open": false, "type": "unknown"}, {"io-status": "ok", "device": "drive_image2", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "bps_max_length": 4294967286, "image": {"virtual-size": 1073741824, "filename": "/home/disk1", "cluster-size": 65536, "format": "qcow2", "actual-size": 118824960, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "refcount-bits": 16, "corrupt": false}}, "dirty-flag": false}, "iops_wr": 0, "group": "", "ro": false, "node-name": "#block570", "backing_file_depth": 0, "drv": "qcow2", "bps_max": 102400, "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 102400, "bps_rd": 0, "cache": {"no-flush": false, "direct": true, "writeback": true}, "file": "/home/disk1", "encryption_key_missing": false}, "type": "unknown"}]} 3. Similar to step2, set the burst_length to be 1000000000 in qmp and check it with qmp cmd '{ "execute": "query-block"}' 4. Set the burst_length to be 10000000000 in qmp and check it with qmp cmd '{ "execute": "query-block"}' Actual results: In steps 2 and 4, the negative value and 10000000000(10 zeros) can be set, and checked from qmp the value became to 4294967286 and 1410065408 In step 3, 1000000000(9 zeros) can be set and checked correctly Expected results: In step2, the negative value is not allowed to set. In step4, if 10000000000(10 zeros) could be set, it should be checked and worked correctly; and an upper limit should be specified. Additional info: