Description of problem: When try to setting device_weight with set_blkio_parameters, it reports error libvirt error code: 8, message: unsupported flags (0x4) in function qemuDomainSetBlkioParameters Version-Release number of selected component (if applicable): libvirt-0.10.0-0rc0.el6.x86_64 perl-Sys-Virt-0.9.10-4.el6.x86_64 kernel-2.6.32-289.el6.x86_64 qemu-kvm-0.12.1.2-2.302.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1.# cat perl-example.pl #!/usr/bin/perl use warnings; use strict; use Sys::Virt; my $uri = "qemu:///system"; my $domname = "vr-rhel6u3-x86_64-kvm"; my $flags = 0; my $con = Sys::Virt->new(address => $uri, readonly => 0); my $dom = $con->get_domain_by_name($domname); my $weight = 600; my $device_weight = '/dev/sda,500'; my %blkio = (Sys::Virt::Domain::BLKIO_WEIGHT => $weight, Sys::Virt::Domain::BLKIO_DEVICE_WEIGHT => $device_weight); $dom->set_blkio_parameters(\%blkio); my $current_weight = $dom->get_blkio_parameters(); print $current_weight->{weight},"\n"; print $current_weight->{device_weight},"\n"; # perl perl-example.pl Actual results: libvirt error code: 8, message: unsupported flags (0x4) in function qemuDomainSetBlkioParameters Expected results: Blkio_device_weight can be set successfully, script executed without error. Additional info:
I also can not set flag for get_blkio_parameters/set_blkio_parameters which include VIR_DOMAIN_AFFECT_CURRENT = 0 : Affect current domain state. VIR_DOMAIN_AFFECT_LIVE = 1 : Affect running domain state. VIR_DOMAIN_AFFECT_CONFIG = 2 : Affect persistent domain state. Usage get from man page $dom->set_blkio_parameters($params, $flags=0) my $params = $dom->get_blkio_parameters($flags=0) %params = (Sys::Virt::Domain::BLKIO_WEIGHT => 600); When I call $dom->set_blkio_parameters(\%params, 1); it will report usage error Usage: Sys::Virt::Domain::set_blkio_parameters(dom, newparams) When I call $dom->get_blkio_parameters(1); it will report usage error Usage: Sys::Virt::Domain::get_blkio_parameters(dom) Without flag, it works fine.
The missing flags parameters are fixed in commit e5b0948d4037c836b76bbfe22d7f91c8ce597362 Author: Osier Yang <jyang> Date: Tue Aug 28 23:52:24 2012 +0800 Fix several APIs These APIs accept one more argument (flags), which was ignored in the XS implementations.
Hi DB, What about the Description problem in https://bugzilla.redhat.com/show_bug.cgi?id=848309#c0 ? Is that won't fix, or not a bug?
> libvirt error code: 8, message: unsupported flags (0x4) in function qemuDomainSetBlkioParameters Oh, i missed that. This is another problem. The perl binding should not be setting the VIR_TYPED_PARAM_STRING_OKAY flag here.
Verify pass on perl-Sys-Virt-0.10.2-2.el6.x86_64 with the following scripts #!/usr/bin/perl use warnings; use strict; use Sys::Virt; my $uri = "qemu:///system"; my $domname = "vr-rhel6u3-x86_64-kvm"; my $flags = 0; my $con = Sys::Virt->new(address => $uri, readonly => 0); my $dom = $con->get_domain_by_name($domname); my $weight = 800; my $device_weight = '/dev/sda,800'; my $weight2 = 700; my $device_weight2 = '/dev/sda,700'; my %blkio = (Sys::Virt::Domain::BLKIO_WEIGHT => $weight, Sys::Virt::Domain::BLKIO_DEVICE_WEIGHT => $device_weight); $dom->set_blkio_parameters(\%blkio, 1); my %blkio2 = (Sys::Virt::Domain::BLKIO_WEIGHT => $weight2, Sys::Virt::Domain::BLKIO_DEVICE_WEIGHT => $device_weight2); $dom->set_blkio_parameters(\%blkio2, 2); my $current_weight = $dom->get_blkio_parameters(1); print "current weight, $current_weight->{weight}\n"; print "current device weight, $current_weight->{device_weight}\n"; my $config_weight = $dom->get_blkio_parameters(2); print "config weight, $config_weight->{weight} \n"; print "config device weight, $config_weight->{device_weight} \n"; result is current weight, 800 current device weight, /dev/sda,800 config weight, 700 config device weight, /dev/sda,700 as expected
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/RHBA-2013-0377.html