Bug 965016

Summary: The libvirt hasn't correctly check I/O throttling capabilities for the QEMU binary
Product: Red Hat Enterprise Linux 7 Reporter: Alex Jia <ajia>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, dyuan, juzhang, mkletzan, mzhan, shyu, ydu, zhwang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.0.6-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 10:40:29 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:

Description Alex Jia 2013-05-20 10:19:17 UTC
Description of problem:
Whether the QEMU binary supports block I/O throttling is irrelevant with VM running or not, it only has relationship with QEMU and libvirt version, if a VM isn't running, libvirt shouldn't allow to change block I/O throttling for the VM.

In addition, with '--config' option for the shutoff guest, I still got the same error message "block I/O throttling not supported with this QEMU binary" with previous. 

Version-Release number of selected component (if applicable):
# rpm -q libvirt qemu-kvm kernel
libvirt-1.0.5-2.el7.x86_64
qemu-kvm-1.4.0-4.el7.x86_64
kernel-3.7.0-0.36.el7.x86_64


How reproducible:
always

Steps to Reproduce:
1. # virsh domstate foo
shut off

2. # virsh blkdeviotune foo vda --write-bytes-sec 1000


Actual results:
# virsh blkdeviotune foo vda --write-bytes-sec 1000
error: Unable to change block I/O throttle
error: unsupported configuration: block I/O throttling not supported with this QEMU binary


Expected results:
error: Unable to change block I/O throttle
error: Requested operation is not valid: domain is not running

and with '--config' or '--current' option, users should successfully
set block I/O throttling for the shutoff status guest.


Additional info:

# virsh blkdeviotune foo vda --write-bytes-sec 1000
error: Unable to change block I/O throttle
error: unsupported configuration: block I/O throttling not supported with this QEMU binary

However, the QEMU owns block I/O throttling capabilities:

# /usr/libexec/qemu-kvm -drive bps_wr=1000 ?
qemu-kvm: -drive bps_wr=1000: drive with bus=0, unit=0 (index=0) exists

Comment 2 Alex Jia 2013-05-21 02:37:44 UTC
(In reply to Alex Jia from comment #0)
> Description of problem:
> Whether the QEMU binary supports block I/O throttling is irrelevant with VM
> running or not, it only has relationship with QEMU and libvirt version, if a

s/QEMU and libvirt version/QEMU version/

> VM isn't running, libvirt shouldn't allow to change block I/O throttling for
> the VM.

Of course, it may have effect on guest XML configuration with '--config' or '--current' option.

In addition, if a VM is running then we can successfully change block I/O throttling parameters.


# virsh domstate foo 
running

# virsh blkdeviotune foo vda --write_iops_sec 100000

# virsh blkdeviotune foo vda
total_bytes_sec: 0
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 0
write_iops_sec : 100000

Comment 3 Martin Kletzander 2013-05-23 12:45:21 UTC
Patch proposed upstream:

http://www.redhat.com/archives/libvir-list/2013-May/msg01696.html

Comment 4 Martin Kletzander 2013-05-24 13:10:37 UTC
Moving to POST with commit v1.0.5-371-g5af3ce8:

commit 5af3ce827767707097affc5e001eab8cbabc28a7
Author: Martin Kletzander <mkletzan>
Date:   Thu May 23 13:07:34 2013 +0200

    Fix blkdeviotune for shutoff domain

Comment 5 yanbing du 2013-06-04 10:23:31 UTC
Hi Martin,
I'm trying to verify this bug with libvirt-1.0.6-1.el7.x86_64. And find when setread_bytes_sec for a shut off guest, virsh still succeed(like using --config flag), i'm not sure if this's expect result, could you help to confirm it, thanks!
 
# virsh domstate test2
shut off

# virsh blkdeviotune test2 vda
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 blkdeviotune test2 vda --read-bytes-sec 1000

# virsh blkdeviotune test2 vda 
total_bytes_sec: 0
read_bytes_sec : 1000
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 0
write_iops_sec : 0

Comment 6 Martin Kletzander 2013-06-07 11:32:45 UTC
(In reply to yanbing du from comment #5)
yes, because by default, if the domain is not running, the flag '--config' is implied.  Same with '--live' and running domain.

Comment 7 yanbing du 2013-06-08 02:36:11 UTC
(In reply to Martin Kletzander from comment #6)
> (In reply to yanbing du from comment #5)
> yes, because by default, if the domain is not running, the flag '--config'
> is implied.  Same with '--live' and running domain.

Thanks for you confirm, then this bug can move to VERIFIED.

Comment 8 Ludek Smid 2014-06-13 10:40:29 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.