Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1131813

Summary: The iotune element will disappear from the guest's xml while set an invalid value
Product: Red Hat Enterprise Linux 6 Reporter: zhenfeng wang <zhwang>
Component: libvirtAssignee: Erik Skultety <eskultet>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.6CC: dyuan, eskultet, lhuang, libvirt-maint, mzhan, rbalakri, virt-bugs, ydu
Target Milestone: rcKeywords: Upstream
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1131811 Environment:
Last Closed: 2015-01-20 13:40:09 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:
Bug Depends On: 1131811    
Bug Blocks:    

Description zhenfeng wang 2014-08-20 06:32:19 UTC
+++ This bug was initially created as a clone of Bug #1131811 +++

Description of problem:
The iotune element will disappear from the guest's xml while set an invalid value

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.Set io parameters for a block device of domain
# virsh domblklist rhel6
Target     Source
------------------------------------------------
hda        /var/lib/libvirt/images/rhel6.img

# virsh blkdeviotune rhel6 hda --write-iops-sec 10 --config

3.Check the setting works
# virsh blkdeviotune rhel6 hda
total_bytes_sec: 0
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 0
write_iops_sec : 10

# virsh dumpxml rhel6 |grep iotune -A 1
      <iotune>
        <write_iops_sec>10</write_iops_sec>
      </iotune>

4.Edit the guest's xml set an invalid iotune value

#virsh edit rhel6
--
<iotune>
        <write_iops_sec>10a</write_iops_sec>
      </iotune>


:wq   //---save the guest's xml

5.Re-check the  io parameters for the block device of domain , the configuration
about the iotune have gone.

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

# virsh dumpxml rhel6  |grep iotune
#

Actual results:
The iotune element will disappear from the guest's xml while set an invalid value

Expected results:
Should report an error while save the guest's xml with an invalid value, and
the configuration about the iotune shouldn't disappear, we should get an expect
error just like following

# virsh edit rhel6
--
<vcpu placement='static'>1a</vcpu>

:wq  //--save the guest's xml
error: XML error: maximum vcpus must be an integer
Failed. Try again? [y,n,f,?]:

Comment 2 Erik Skultety 2014-08-26 07:25:58 UTC
Fixed upstream:

commit d60c33c6b5f84eb1468054374f5272189477f713
Author: Erik Skultety <eskultet>
Date:   Mon Aug 25 10:50:12 2014 +0200

    iotune: setting an invalid value now reports error
    
    When trying to set an invalid value into iotune element, standard
    behavior was to not report any error, rather to reset all affected
    subelements of the iotune element back to 0 which results in ignoring
    those particular subelements by XML generator. Patch further
    examines the return code of the virXPathULongLong function
    and in case of an invalid non-integer value raises an error.
    Fixed to preserve consistency with invalid value checking
    of other elements.
    
    Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1131811

v1.2.7-224-gd60c33c