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 768870 - Guest can not be started with <iotune> setting in xml
Summary: Guest can not be started with <iotune> setting in xml
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Martin Kletzander
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-19 08:45 UTC by weizhang
Modified: 2012-06-20 06:39 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.9.10-1.el6
Doc Type: Bug Fix
Doc Text:
No Documentation needed
Clone Of:
Environment:
Last Closed: 2012-06-20 06:39:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Description weizhang 2011-12-19 08:45:42 UTC
Description of problem:
Guest can not be started after setting iotune on guest disk
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/kvm-rhel6u2-x86_64-new.img'/>
      <target dev='hda' bus='ide'/>
      <iotune>
        <total_bytes_sec>10000000</total_bytes_sec>
        <read_iops_sec>400000</read_iops_sec>
        <write_iops_sec>100000</write_iops_sec>
      </iotune>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
...

After adding <iotune> in guest, with dumpxml guest, we can see that the iotune section disordered like
...
      <iotune>
        <total_bytes_sec>10000000</total_bytes_sec>
        <read_iops_sec>400000</read_iops_sec>        <write_iops_sec>100000</write_iops_sec>      </iotune>
...
and with start guest, it will report error
# virsh start kvm-rhel6u2-x86_64-new
error: Failed to start domain kvm-rhel6u2-x86_64-new
error: internal error Process exited while reading console log output: qemu-kvm: -drive file=/var/lib/libvirt/images/kvm-rhel6u2-x86_64-new.img,if=none,id=drive-ide0-0-0,format=raw,cache=none,bps=10000000,iops_rd=400000,iops_wr=100000: Invalid parameter 'bps'
char device redirected to /dev/pts/1
qemu-kvm: -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1: Property 'ide-drive.drive' can't find value 'drive-ide0-0-0'

Version-Release number of selected component (if applicable):
kernel-2.6.32-223.el6.x86_64
qemu-kvm-0.12.1.2-2.210.el6.x86_64
libvirt-0.9.8-1.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. define a guest and adding
      <iotune>
        <total_bytes_sec>10000000</total_bytes_sec>
        <read_iops_sec>400000</read_iops_sec>
        <write_iops_sec>100000</write_iops_sec>
      </iotune>
to disk section and save
2. virsh dumpxml guest
3. start guest
  
Actual results:
the guest xml disordered and can not start guest

Expected results:
the guest xml is formatted and can be started successfully. 

Additional info:

Comment 1 weizhang 2011-12-19 10:21:57 UTC
also can be reproduced on qemu-kvm-0.12.1.2-2.211.el6.x86_64

Comment 2 Eric Blake 2011-12-19 14:30:09 UTC
Use of <iotune> requires a feature added in the upcoming qemu 1.1.  It is not available on RHEL, so failure to start a guest is expected unless someone opens a bug to backport bps= and friends to the qemu command line.

As for XML being mis-formatted, yes, that should be fixed.

Comment 3 Dave Allan 2012-01-17 17:08:05 UTC
Anything libvirt can do here to provide a better error message?

Comment 4 Martin Kletzander 2012-01-17 18:23:15 UTC
Misformatting fixed in commit abd076938df2854d6c75be393a72e4c8936dfafc
Author: Martin Kletzander <mkletzan>
Date:   Mon Jan 16 14:43:23 2012 +0100

Fixed dumxml of <iotune> parameters

The output of dumpxml for <iotune> settings was misformatted, this patch just
adds missing newlines.

Comment 5 Eric Blake 2012-01-17 18:51:20 UTC
(In reply to comment #4)
> Misformatting fixed in commit abd076938df2854d6c75be393a72e4c8936dfafc

Actual upstream commit id is:

e1eb93470edfdeaa06c4435f280a59ba0b9bc92e

> Author: Martin Kletzander <mkletzan>
> Date:   Mon Jan 16 14:43:23 2012 +0100
> 
> Fixed dumxml of <iotune> parameters
> 
> The output of dumpxml for <iotune> settings was misformatted, this patch just
> adds missing newlines.

Comment 6 Eric Blake 2012-01-17 18:56:10 UTC
(In reply to comment #3)
> Anything libvirt can do here to provide a better error message?

It's probably possible to parse 'qemu -h' output to see if -drive supports bps= and friends, and set a qemu_capabilities.h flag bit accordingly, so that we can indeed give a better error message up front if we know qemu won't support it.

Comment 7 Dave Allan 2012-01-17 19:36:18 UTC
(In reply to comment #6)
> It's probably possible to parse 'qemu -h' output to see if -drive supports bps=
> and friends, and set a qemu_capabilities.h flag bit accordingly, so that we can
> indeed give a better error message up front if we know qemu won't support it.

That seems like something worth doing to me rather than just barfing out the qemu failure.

Comment 8 Martin Kletzander 2012-01-18 16:03:49 UTC
Error reporting fixed in commit 5fafc63ec61f3c453cc0fed8b4a83709154bd1bf
Author: Martin Kletzander <mkletzan>
Date:   Wed Jan 18 16:34:28 2012 +0100

Added capability checking for block <iotune> setting.

There was missing capability for blkiotune and thus specifying these
settings caused libvirt to run qemu with invalid parameters and then
reporting qemu error instead of the standard libvirt one.

Comment 10 Eric Blake 2012-01-18 17:02:18 UTC
Actual upstream commit id changed due to v2 of patch; moving this to POST.

commit 4c82f09ef08674be77f461600195d0a646105306
Author: Martin Kletzander <mkletzan>
Date:   Wed Jan 18 17:42:33 2012 +0100

    Added capability checking for block <iotune> setting.
    
    There was missing capability for blkiotune and thus specifying these
    settings caused libvirt to run qemu with invalid parameters and then
    reporting qemu error instead of the standard libvirt one. The support
    for blkiotune setting was added in upstream qemu repo under commit
    0563e191516289c9d2f282a8c50f2eecef2fa773.

Comment 13 zhe peng 2012-02-15 03:08:23 UTC
I can reproduce this issue with:
libvirt-0.9.9-1.el6.x86_64
qemu-kvm-0.12.1.2-2.213.el6.x86_64


verify with:
libvirt-0.9.10-1.el6.x86_64
qemu-kvm-0.12.1.2-2.229.el6.x86_64

step:
After adding <iotune> in guest, with dumpxml guest, can see that the iotune
section disordered like
...
      <iotune>
        <total_bytes_sec>10000000</total_bytes_sec>
        <read_iops_sec>400000</read_iops_sec>
        <write_iops_sec>100000</write_iops_sec>
      </iotune>
...
then start the guest
# virsh start v1-clone
error: Failed to start domain v1-clone
error: unsupported configuration: block I/O throttling not supported with this QEMU binary
it's expected error message.
verification passed.
move to verified.

Comment 14 Martin Kletzander 2012-05-03 13:13:04 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No Documentation needed

Comment 16 errata-xmlrpc 2012-06-20 06:39:22 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


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