Bug 819014

Summary: blockIoTune modifies live xml even on failure
Product: Red Hat Enterprise Linux 6 Reporter: Eric Blake <eblake>
Component: libvirtAssignee: Eric Blake <eblake>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 6.3CC: acathrow, ajia, bsarathy, dallan, dyasny, dyuan, eblake, gsun, jyang, mjenner, mzhan, rwu, veillard, weizhan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.9.10-17.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 770683 Environment:
Last Closed: 2012-06-20 06:57:57 UTC Type: ---
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: 770683    
Bug Blocks:    

Comment 1 Eric Blake 2012-05-04 15:41:48 UTC
Modifying the live xml even when the monitor command fails is problematic, because you can end up with corrupted xml that will prevent a managedsave/restore cycle on the domain.  The fix is a one-liner (move the change to the live xml to occur after the check for error).

Comment 2 Eric Blake 2012-05-04 15:59:32 UTC
Upstream patch proposed:
https://www.redhat.com/archives/libvir-list/2012-May/msg00322.html

Comment 6 dyuan 2012-05-11 09:04:16 UTC
Verified PASS with libvirt-0.9.10-18.el6.

# virsh blkdeviotune xp hda --total_bytes_sec 1000
error: Unable to change block I/O throttle
error: unsupported configuration: block I/O throttling not supported with this QEMU binary

# virsh dumpxml xp
...
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/winXP-32-virtio.qcow2'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
...

Reproduced it with libvirt-0.9.10-16.el6.

# virsh blkdeviotune xp hda --total_bytes_sec 1000
error: Unable to change block I/O throttle
error: internal error Unexpected error

# virsh dumpxml xp|grep disk -A 10
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/winXP-32-virtio.qcow2'/>
      <target dev='hda' bus='ide'/>
      <iotune>
        <total_bytes_sec>1000</total_bytes_sec>
      </iotune>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

Comment 8 errata-xmlrpc 2012-06-20 06:57:57 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.

http://rhn.redhat.com/errata/RHSA-2012-0748.html