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 800734 - Error prompt when calling $dom->set_blkio_parameters API
Summary: Error prompt when calling $dom->set_blkio_parameters API
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: perl-Sys-Virt
Version: 6.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Daniel Berrangé
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 804028
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-07 05:47 UTC by xhu
Modified: 2012-06-20 12:00 UTC (History)
6 users (show)

Fixed In Version: perl-Sys-Virt-0.9.10-3.el6
Doc Type: Bug Fix
Doc Text:
Cause The Perl API bindings did not handle tunable parameters in string format Consequence It was not possible to read/update the block I/O tunable parameters Fix Support for string parameters was implemented Result The block I/O tunable parameters can be read/updated from the Perl API.
Clone Of:
: 804028 (view as bug list)
Environment:
Last Closed: 2012-06-20 12:00:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch for the issue. (1.65 KB, patch)
2012-03-07 07:22 UTC, Alex Jia
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0754 0 normal SHIPPED_LIVE perl-Sys-Virt bug fix and enhancement update 2012-06-19 19:31:07 UTC

Description xhu 2012-03-07 05:47:20 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:
everytimes

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 
#!/usr/bin/perl
use warnings;
use strict;
use Sys::Virt;

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);
$dom->set_blkio_parameters(\%blkio);

2. Run set_blkio.pl:
# perl set_blkio.pl 
libvirt error code: 8, message: invalid argument: unable to parse
  
Actual results:
After step 2, error prompt

Expected results:
should set blkio weight successfully.

Additional info:

Comment 1 Alex Jia 2012-03-07 07:18:40 UTC
Hi Daniel,
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,
Alex

Comment 2 Alex Jia 2012-03-07 07:22:18 UTC
Created attachment 568174 [details]
patch for the issue.

Comment 3 xhu 2012-03-07 07:51:17 UTC
The component version are as follows:
perl-Sys-Virt-0.9.10-2.el6.x86_64
libvirt-0.9.10-4.el6.x86_64
qemu-kvm-0.12.1.2-2.234.el6.x86_64

Comment 4 Daniel Berrangé 2012-03-16 11:13:05 UTC
Pushed a variant on Alex's patch upstream.

commit a9ab38ef284915198c34c375592534bd9598db4c
Author: Alex Jia <ajia>
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

Comment 8 Daniel Berrangé 2012-05-01 09:08:39 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:
Cause
    The Perl API bindings did not handle tunable parameters in string format
Consequence
    It was not possible to read/update the block I/O tunable parameters
Fix
    Support for string parameters was implemented
Result
    The block I/O tunable parameters can be read/updated from the Perl API.

Comment 10 errata-xmlrpc 2012-06-20 12:00:57 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/RHBA-2012-0754.html


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