Red Hat Bugzilla – Bug 800734
Error prompt when calling $dom->set_blkio_parameters API
Last modified: 2012-06-20 08:00:57 EDT
Description of problem:
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Make sure you have a running guest named "vr-rhel6-x86_64-kvm"
1. prepare set_blkio.pl as follows:
# cat set_blkio.pl
my $uri = "qemu:///system";
my $domname = "vr-rhel6-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 %blkio = (Sys::Virt::Domain::BLKIO_WEIGHT => $weight);
2. Run set_blkio.pl:
# perl set_blkio.pl
libvirt error code: 8, message: invalid argument: unable to parse
After step 2, error prompt
should set blkio weight successfully.
It may be a common issues, the set_block_iotune(), set_interface_parameters() and set_numa_parameters() probably have similar issues. For set_blkio_parameters(), the argument device_weight is a string type, however, the vir_typed_param_from_hv() and vir_typed_param_to_hv() are missing 'case VIR_TYPED_PARAM_STRING' branch and related handling.
In addition, in set_blkio_parameters(), the vir_typed_param_from_hv(newparams, params, nparams) will return a newparams reference, but the virDomainSetBlkioParameters(dom, params, nparams, 0) hasn't used it, I think the second parameter should be 'newparams' and need to covert data type to virBlkioParameter/virTypedParameterPtr, unfortunately, it doesn't work for me, it seems I gave a error data type, the attachment is my patch, please help see this issue.
Regards & Thanks,
Created attachment 568174 [details]
patch for the issue.
The component version are as follows:
Pushed a variant on Alex's patch upstream.
Author: Alex Jia <email@example.com>
Date: Fri Mar 16 10:38:54 2012 +0000
Add handling of VIR_TYPED_PARAM_STRING
This also requires bug 804028 in libvirt to be fixed, before re-testing
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.
The Perl API bindings did not handle tunable parameters in string format
It was not possible to read/update the block I/O tunable parameters
Support for string parameters was implemented
The block I/O tunable parameters can be read/updated from the Perl API.
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.