Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 770795 - blkioParameters doesn't work
blkioParameters doesn't work
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Osier Yang
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-29 01:42 EST by Alex Jia
Modified: 2013-02-21 02:06 EST (History)
6 users (show)

See Also:
Fixed In Version: libvirt-0.9.13-3.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:06:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 16:18:26 EST

  None (edit)
Description Alex Jia 2011-12-29 01:42:39 EST
Description of problem:
virsh blkiotune works well, and can get current blkio parameters for a guest,
but blkioParameters python binding API doesn't work and return None. 

In addition, blkioParameters hasn't judged return value from libvirt.py.

# virsh blkiotune foo
weight         : 200
device_weight  : 


Version-Release number of selected component (if applicable):
libvirt-python-0.9.8-1.el6.x86_64

How reproducible:
always

Steps to Reproduce:
# python
Python 2.6.6 (r266:84292, Sep 12 2011, 14:03:14) 
[GCC 4.4.5 20110214 (Red Hat 4.4.5-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> con = libvirt.open(None)
>>> dom = con.lookupByName('foo')
>>> print dom.blkioParameters(0)
None


Expected results:
blkioParameters works well like virsh blkiotune.

Additional info:
Will try to commit a patch for the bug.
Comment 1 Alex Jia 2011-12-29 06:13:37 EST
Patch for upstream:
https://www.redhat.com/archives/libvir-list/2011-December/msg01094.html
Comment 2 Alex Jia 2011-12-29 06:15:01 EST
And the above patch also fix issue of the setBlkioParameters python binding API.
Comment 3 Alex Jia 2012-01-16 22:30:41 EST
v2 patch for upstream:
https://www.redhat.com/archives/libvir-list/2011-December/msg01122.html
Comment 4 Alex Jia 2012-02-06 03:29:33 EST
The patch need to be updated according to latest libvirt change, for example, reusing utility library function in python binding codes, in addition, also need to wait for codes re-factoring about python binding part.
Comment 5 Alex Jia 2012-02-10 04:40:49 EST
The v3 patch has been sent to upstream and wait for review:
https://www.redhat.com/archives/libvir-list/2012-February/msg00525.html
Comment 6 Alex Jia 2012-02-16 11:51:11 EST
The following patch has fixed the issue instead, In POST:
 commit 56cec18d761a1f99862c43811de60380c65881e6
Author: Guannan Ren <gren@redhat.com>
Date:   Fri Feb 10 18:17:26 2012 +0800

    python: make other APIs share common {get, set}PyVirTypedParameter
    
            *libvirt_virDomainBlockStatsFlags
            *libvirt_virDomainGetSchedulerParameters
            *libvirt_virDomainGetSchedulerParametersFlags
            *libvirt_virDomainSetSchedulerParameters
            *libvirt_virDomainSetSchedulerParametersFlags
            *libvirt_virDomainSetBlkioParameters
            *libvirt_virDomainGetBlkioParameters
            *libvirt_virDomainSetMemoryParameters
            *libvirt_virDomainGetMemoryParameters
            *libvirt_virDomainSetBlockIoTune
            *libvirt_virDomainGetBlockIoTune
Comment 9 Wayne Sun 2012-07-24 06:39:35 EDT
pkgs:
libvirt-0.9.13-3.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.297.el6_3.x86_64
kernel-2.6.32-280.el6.x86_64

steps:

# virsh blkiotune aaa
weight         : 500
device_weight  : 

In another terminal:
# python
Python 2.6.6 (r266:84292, May  1 2012, 13:52:17) 
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> conn = libvirt.open(None)
>>> domobj = conn.lookupByName("aaa")
>>> domobj.blkioParameters(0)
{'device_weight': '', 'weight': 500}

switch back and run:
# virsh blkiotune aaa 1000

switch to python:
>>> domobj.blkioParameters(0)
{'device_weight': '', 'weight': 1000}

So, it's fine now.
Comment 10 errata-xmlrpc 2013-02-21 02:06:58 EST
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/RHSA-2013-0276.html

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