RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1131876 - The range for blkdeviotune was different in guest's xml and virsh command line
Summary: The range for blkdeviotune was different in guest's xml and virsh command line
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Erik Skultety
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-20 08:17 UTC by zhenfeng wang
Modified: 2015-03-05 07:42 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.2.8-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:42:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description zhenfeng wang 2014-08-20 08:17:14 UTC
Description of problem:
The range for blkdeviotune was different in guest's xml and virsh command line

Version-Release number of selected component (if applicable):
libvirt-1.2.7-1.el7.x86_64
qemu-kvm-rhev-2.1.0-1.el7.x86_64
kernel-3.10.0-142.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1.Prepare a normal guest
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     rhel6                          shut off

2.Edit the guest's xml, add the following content
#virsh edit rhel6
--
<disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/rhel6.img'/>
      <target dev='hda' bus='ide'/>
      <iotune>
        <read_bytes_sec>-1</read_bytes_sec>
        <read_iops_sec>-1</read_iops_sec>
      </iotune>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

# virsh blkdeviotune rhel6 hda
total_bytes_sec: 0
read_bytes_sec : 18446744073709551615
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 18446744073709551615
write_iops_sec : 0

3.Start the guest, then re-check the settings, the setting in guest's xml was still the
previous one, however, the virsh cmd show different result.
#virsh start rhel6

#virsh dumpxml rhel6
<disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/rhel6.img'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <iotune>
        <read_bytes_sec>18446744073709551615</read_bytes_sec>
        <read_iops_sec>18446744073709551615</read_iops_sec>
      </iotune>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

# virsh blkdeviotune rhel6 hda
total_bytes_sec: 0
read_bytes_sec : 9223372036854775808
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 9223372036854775808
write_iops_sec : 0

4.Set the read-bytes-sec=18446744073709551615 in virsh cmd, it will report
error

# virsh blkdeviotune rhel6 hda --read-bytes-sec 18446744073709551615
error: Unable to change block I/O throttle
error: numerical overflow: block I/O throttle limit value must be less than 9223372036854775807



Actual results:
The range for blkdeviotune was different in guest's xml and virsh command line

Expected results:
The range for blkdeviotune should be corresponding in guest's xml and virsh command line

Comment 1 zhenfeng wang 2014-08-20 08:20:39 UTC
It will report the following error while start the guest in step 3 when download the qemu-kvm-rhev packet version to qemu-kvm-rhev-1.5.3-60.el7ev_0.2.x86_64, maybe
this issue have relationship with qemu-kvm, please check it.

# virsh start rhel6
error: Failed to start domain rhel6
error: internal error: process exited while connecting to monitor: 2014-08-20T06:26:33.570376Z qemu-kvm: -drive file=/var/lib/libvirt/images/rhel6.img,if=none,id=drive-virtio-disk0,format=raw,cache=none,bps_rd=18446744073709551615,iops_rd=18446744073709551615: bps and iops values must be 0 or greater

after i updated qemu-kvm-rhev version guest can start and found:
# virsh blkdeviotune rhel6 hda
total_bytes_sec: 0
read_bytes_sec : 9223372036854775808
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 9223372036854775808
write_iops_sec : 0

Comment 3 Erik Skultety 2014-08-27 08:33:26 UTC
Fixed upstream:

commit 2f0944dec1caf0ae842f28bb4e739417244210a0
Author: Erik Skultety <eskultet>
Date:   Tue Aug 26 13:29:10 2014 +0200

    blkdeviotune: check for overflow when parsing XML
    
    According to docs/schemas/domaincommon.rng and _virDomainBlockIoTuneInfo
    all the iotune values are interpreted as unsigned long long, however
    according to qemu_monitor_json.c, qemu silently truncates numbers
    larger than LLONG_MAX. There's really not much of a usage for such
    large numbers anyway yet. This patch provides the same overflow
    check during a domain start as it does during setting
    a blkdeviotune element in qemu_driver.c and thus reports an error when
    a larger number than LLONG_MAX is detected.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1131876

v1.2.7-233-g2f0944d

Comment 5 zhengqin 2014-09-10 06:06:55 UTC
Verified with build libvirt-1.2.8-1.el7.x86_64:

1.Prepare a normal guest
[root@rhel7-a1 nfs]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     rhel6                          shut off

2.Edit the guest's xml, add the following content

[root@rhel7-a1 nfs]#virsh edit rhel6

    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/rhel6.img'/>
      <target dev='hda' bus='ide'/>
      <iotune>
        <read_bytes_sec>1</read_bytes_sec>
        <read_iops_sec>1</read_iops_sec>
      </iotune>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

3. Check blkdeviotune
[root@rhel7-a1 nfs]# virsh blkdeviotune rhel6 hda
total_bytes_sec: 0
read_bytes_sec : 1
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 1
write_iops_sec : 0

4. Start the guest 
[root@rhel7-a1 nfs]# virsh start rhel6
Domain rhel6 started


5. Check blkdeviotune again
[root@rhel7-a1 nfs]# virsh blkdeviotune rhel6 hda
total_bytes_sec: 0
read_bytes_sec : 1
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 1
write_iops_sec : 0

6. Check dumpxml for guest
[root@rhel7-a1 nfs]# virsh dumpxml rhel6
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/rhel6.img'/>
        <seclabel model='selinux' labelskip='yes'/>
      </source>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <iotune>
        <read_bytes_sec>1</read_bytes_sec>
        <read_iops_sec>1</read_iops_sec>
      </iotune>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
 

7. Set the large number for --read-bytes-sec 
[root@rhel7-a1 nfs]# virsh blkdeviotune rhel6 hda --read-bytes-sec 18446744073709551615
error: Unable to change block I/O throttle
error: numerical overflow: block I/O throttle limit value must be less than 9223372036854775807


8. Set the reasonable number for --read-bytes-sec 
[root@rhel7-a1 nfs]# virsh blkdeviotune rhel6 hda --read-bytes-sec 9223372036854775807


9. Check blkdeviotune
[root@rhel7-a1 nfs]# virsh blkdeviotune rhel6 hda 
total_bytes_sec: 0
read_bytes_sec : 9223372036854775807
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 1
write_iops_sec : 0


10. Set the large number for --read-bytes-sec 
[root@rhel7-a1 nfs]# virsh blkdeviotune rhel6 hda --read-bytes-sec 9223372036854775808
error: Unable to change block I/O throttle
error: numerical overflow: block I/O throttle limit value must be less than 9223372036854775807

11. Set the large number for --read_iops_sec  
[root@rhel7-a1 nfs]# virsh blkdeviotune rhel6 hda --read_iops_sec 9223372036854775808
error: Unable to change block I/O throttle
error: numerical overflow: block I/O throttle limit value must be less than 9223372036854775807

12. Set the reasonable number for --read_iops_sec
[root@rhel7-a1 nfs]# virsh blkdeviotune rhel6 hda --read_iops_sec 9223372036854775807


13. Check blkdeviotune
[root@rhel7-a1 nfs]# virsh blkdeviotune rhel6 hda 
total_bytes_sec: 0
read_bytes_sec : 9223372036854775807
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 9223372036854775807
write_iops_sec : 0

Comment 6 vivian zhang 2014-12-01 07:29:41 UTC
I can produce this bug on build qemu-kvm-rhev-2.1.0-1.el7.x86_64 libvirt-1.2.7-1.el7.x86_64

verify it on build
libvirt-1.2.8-9.el7.x86_64
qemu-kvm-rhev-2.1.2-14.el7.x86_64
3.10.0-208.el7.x86_64

verify steps

1. prepare a guest in shutoff with iotune
# virsh list --all
 Id    Name                           State
----------------------------------------------------
-     rhel7new                       shut off

# virsh edit rhel7new
...
<iotune>
        <read_bytes_sec>-1</read_bytes_sec>
        <write_bytes_sec>-1</write_bytes_sec>
        <read_iops_sec>-1</read_iops_sec>
        <write_iops_sec>-1</write_iops_sec>
      </iotune>
...

2. # virsh blkdeviotune rhel7new hda
total_bytes_sec: 0
read_bytes_sec : 18446744073709551615
write_bytes_sec: 18446744073709551615
total_iops_sec : 0
read_iops_sec  : 18446744073709551615
write_iops_sec : 18446744073709551615

# virsh dumpxml rhel7new
...
<iotune>
        <read_bytes_sec>18446744073709551615</read_bytes_sec>
        <write_bytes_sec>18446744073709551615</write_bytes_sec>
        <read_iops_sec>18446744073709551615</read_iops_sec>
        <write_iops_sec>18446744073709551615</write_iops_sec>
      </iotune>
...

3. start guest, report error
# virsh start rhel7new
error: Failed to start domain rhel7new
error: numerical overflow: block I/O throttle limit must be less than 9223372036854775807 using QEMU

4. set invalid value with virsh command, report the same error
# virsh blkdeviotune rhel7new hda --read_bytes_sec 18446744073709551615
error: Unable to change block I/O throttle
error: numerical overflow: block I/O throttle limit value must be less than 9223372036854775807

# virsh blkdeviotune rhel7new hda --write_bytes_sec 18446744073709551615
error: Unable to change block I/O throttle
error: numerical overflow: block I/O throttle limit value must be less than 9223372036854775807

# virsh blkdeviotune rhel7new hda --read_iops_sec 18446744073709551615
error: Unable to change block I/O throttle
error: numerical overflow: block I/O throttle limit value must be less than 9223372036854775807

# virsh blkdeviotune rhel7new hda --write_iops_sec 18446744073709551615
error: Unable to change block I/O throttle
error: numerical overflow: block I/O throttle limit value must be less than 9223372036854775807

5. set valid value with virsh command, set success, and dumpxml to check the value changed, guest start success
# virsh blkdeviotune rhel7new hda --write_bytes_sec 9223372036854775807

[root@server ~]# virsh blkdeviotune rhel7new hda
total_bytes_sec: 0
read_bytes_sec : 0
write_bytes_sec: 9223372036854775807
total_iops_sec : 0
read_iops_sec  : 18446744073709551615
write_iops_sec : 18446744073709551615

# virsh blkdeviotune rhel7new hda --read_bytes_sec 9223372036854775807

[root@server ~]# virsh blkdeviotune rhel7new hda
total_bytes_sec: 0
read_bytes_sec : 9223372036854775807
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 18446744073709551615
write_iops_sec : 18446744073709551615

# virsh blkdeviotune rhel7new hda --read_iops_sec 9223372036854775807

[root@server ~]# virsh blkdeviotune rhel7new hda
total_bytes_sec: 0
read_bytes_sec : 9223372036854775807
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 9223372036854775807
write_iops_sec : 0

# virsh blkdeviotune rhel7new hda --write_iops_sec 9223372036854775807

# virsh blkdeviotune rhel7new hda
total_bytes_sec: 0
read_bytes_sec : 9223372036854775807
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 0
write_iops_sec : 9223372036854775807

# virsh blkdeviotune rhel7new hda --write_iops_sec 9223372036854775808
error: Unable to change block I/O throttle
error: numerical overflow: block I/O throttle limit value must be less than 9223372036854775807

]# virsh blkdeviotune rhel7new hda --write_iops_sec 9223372036854775808
error: Unable to change block I/O throttle
error: numerical overflow: block I/O throttle limit value must be less than 9223372036854775807

[root@server ~]# virsh blkdeviotune rhel7new hda --read_iops_sec 9223372036854775808
error: Unable to change block I/O throttle
error: numerical overflow: block I/O throttle limit value must be less than 9223372036854775807

[root@server ~]# virsh blkdeviotune rhel7new hda --read_iops_sec 0

[root@server ~]# virsh blkdeviotune rhel7new hda --read_iops_sec -1
error: Unable to parse integer parameter

[root@server ~]# virsh blkdeviotune rhel7new hda --write_bytes_sec -1
error: Unable to parse integer parameter

[root@server ~]# virsh blkdeviotune rhel7new hda --write_bytes_sec 0

[root@server ~]# virsh blkdeviotune rhel7new hda --write_bytes_sec 9223372036854775808
error: Unable to change block I/O throttle
error: numerical overflow: block I/O throttle limit value must be less than 9223372036854775807

6. start guest success, and login works well also
# virsh start rhel7new
Domain rhel7new started
7. check virsh command set value for blkdeviotune are the same with xml dumpxml result
# virsh dumpxml rhel7new
...
 <iotune>
        <read_bytes_sec>9223372036854775807</read_bytes_sec>
        <write_iops_sec>9223372036854775807</write_iops_sec>
      </iotune>
...

move to verified

Comment 8 errata-xmlrpc 2015-03-05 07:42:54 UTC
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://rhn.redhat.com/errata/RHSA-2015-0323.html


Note You need to log in before you can comment on or make changes to this bug.