Bug 804664

Summary: [libvirt] Failed to set vm niceness with latest libvirt
Product: [Fedora] Fedora Reporter: Haim <hateya>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: abaron, acathrow, bazulay, berrange, clalancette, crobinso, dallan, dougsland, eblake, hateya, iheim, itamar, jforbes, jyang, laine, libvirt-maint, veillard, virt-maint, yeylon, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 807751 (view as bug list) Environment:
Last Closed: 2012-03-28 11:33:59 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 807751, 816609    

Description Haim 2012-03-19 10:37:02 EDT
Description of problem:

vdsm fails to set vm niceness working with latest libvirt: libvirt-0.9.10-2.fc17.x86_64

I get the following trace:

Traceback (most recent call last):
  File "/usr/share/vdsm/libvirtvm.py", line 1232, in _domDependentInit
    self._dom.setSchedulerParameters({'cpu_shares': (20 - nice) * 51})
  File "/usr/share/vdsm/libvirtvm.py", line 490, in f
    ret = attr(*args, **kwargs)
  File "/usr/share/vdsm/libvirtconnection.py", line 82, in wrapper
    ret = f(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 1788, in setSchedulerParameters
    ret = libvirtmod.virDomainSetSchedulerParameters(self._o, params)
SystemError: /builddir/build/BUILD/Python-2.7.2/Objects/longobject.c:980: bad argument to internal function

I suspect libvirt changed something.

note that problem doesn't occur with libvirt-0.9.9-1.fc16.x86_64.
Comment 1 Haim 2012-03-19 10:38:25 EDT
The function in libvirt called: VIR_DOMAIN_SCHEDULER_CPU_SHARES, tried to look for clues in their git src with no luck, i'm sure danken would know.
Comment 2 Haim 2012-03-19 10:45:50 EDT
According to eblake, libvirt team did touch the python bindings, in an effort to clean up some undefined behavior and share more code between the various clients of the C code virTypedParameter and scheduler cpu shares is a client of virTypedParameter, so maybe we introduced a regression in our typed parameter handling
Comment 3 Eric Blake 2012-03-28 11:33:59 EDT
F17 will pick up 0.9.11, where this is fixed with:

commit 1aeb3d9e7f3a967f7d5e59f852e804aef0786f6c
Author: Guannan Ren <gren@redhat.com>
Date:   Tue Mar 27 14:06:47 2012 +0800

    python: make python APIs use these helper functions
    
        *setPyVirTypedParameter
        *libvirt_virDomainGetCPUStats