I've tested the patchset successful with virsh command for both kvm and lxc vm.
Details are as following:
--------------------------------------KVM-------------------------
root@debian:~/images# virsh version
Compiled against library: libvirt 1.2.0
Using library: libvirt 1.2.0
Using API: QEMU 1.2.0
Running hypervisor: QEMU 1.7.0
 
root@debian:~/images# virsh blkiotune kvm
weight         : 500
device_weight  :
device_read_iops:
device_write_iops:
device_read_bps:
device_write_bps:
 
root@debian:~/images# virsh blkiotune kvm --device-weights /dev/vda,250 --device-read-iops /dev/vda,1234567 --device-write-iops /dev/vda,2345678 --device-read-bps /dev/vda,123456789 --device-write-bps /dev/vda,234567890  --config --live                    
 
root@debian:~/images# virsh blkiotune kvm
weight         : 500
device_weight  : /dev/vda,250
device_read_iops: /dev/vda,1234567
device_write_iops: /dev/vda,2345678
device_read_bps: /dev/vda,123456789
device_write_bps: /dev/vda,234567890
 
root@debian:~/images# cat /sys/fs/cgroup/blkio/machine/kvm.libvirt-qemu/blkio.weight_device
254:0 250          
root@debian:~/images# cat /sys/fs/cgroup/blkio/machine/kvm.libvirt-qemu/blkio.throttle.read_bps_device
254:0 123456789
root@debian:~/images# cat /sys/fs/cgroup/blkio/machine/kvm.libvirt-qemu/blkio.throttle.read_iops_device 
254:0 1234567
root@debian:~/images# cat /sys/fs/cgroup/blkio/machine/kvm.libvirt-qemu/blkio.throttle.write_bps_device     
254:0 234567890
root@debian:~/images# cat /sys/fs/cgroup/blkio/machine/kvm.libvirt-qemu/blkio.throttle.write_iops_device 
254:0 2345678
 
---------------------------- lxc ----------------------------------
root@debian:~/images# vir version
Compiled against library: libvirt 1.2.0
Using library: libvirt 1.2.0
Using API: LXC 1.2.0
Running hypervisor: LXC 3.10.11
 
root@debian:~/images# vir blkiotune lxc --device-weights /dev/vda,250 --device-read-iops /dev/vda,1234567 --device-write-iops /dev/vda,2345678 --device-read-bps /dev/vda,123456789 --device-write-bps /dev/vda,234567890  --config --live
 
root@debian:~/images# vir blkiotune lxc
weight         : 500
device_weight  : /dev/vda,250
device_read_iops: /dev/vda,1234567
device_write_iops: /dev/vda,2345678
device_read_bps: /dev/vda,123456789
device_write_bps: /dev/vda,234567890
 
root@debian:~/images# vir blkiotune lxc --device-weights /dev/vda,270 --device-read-iops /dev/vda,111111111 --device-write-iops /dev/vda,22222222 --device-read-bps /dev/vda,333336789 --device-write-bps /dev/vda,5555555  --config --live                                      
 
root@debian:~/images# vir blkiotune lxc
weight         : 500
device_weight  : /dev/vda,270
device_read_iops: /dev/vda,111111111
device_write_iops: /dev/vda,22222222
device_read_bps: /dev/vda,333336789
device_write_bps: /dev/vda,5555555
 
root@debian:~/images# cat /sys/fs/cgroup/blkio/machine/lxc.libvirt-lxc/blkio.weight_device
254:0 270
root@debian:~/images# cat /sys/fs/cgroup/blkio/machine/lxc.libvirt-lxc/blkio.throttle.read_iops_device
254:0 111111111
root@debian:~/images# cat /sys/fs/cgroup/blkio/machine/lxc.libvirt-lxc/blkio.throttle.write_iops_device    
254:0 22222222
root@debian:~/images# cat /sys/fs/cgroup/blkio/machine/lxc.libvirt-lxc/blkio.throttle.read_bps_device       
254:0 333336789
root@debian:~/images# cat /sys/fs/cgroup/blkio/machine/lxc.libvirt-lxc/blkio.throttle.write_bps_device  
254:0 5555555
 
On 2013-12-03 16:44 , Gao feng wrote:
On 12/03/2013 10:48 AM, hzguanqiang@corp.netease.com wrote:
> On 2013-12-02 14:47 , Gao feng <mailto:gaofeng@cn.fujitsu.com> wrote:
>
>     Right now, libvirt only supports the cfq based blkio cgorup,
>     this means if the block devices doesn't use cfq scheduler, the
>     blkio cgroup will loss effect.
>     
>     This patchset adds the throttle blkio cgroup support for libvirt,
>     intoduces four elements for domain configuration and extend the
>     virsh command blkiotune.
>
> intoduces/introduces/s
 
 
Oh, my hand slip. Thanks!
 
BTW, chould you help to review or test this patchset?
It runs well in my test box.
 
Thanks.
 
------------------    
Best regards!
GuanQiang
12:46:48