Bug 916493

Summary: pinEmulator and emulatorPinInfo should be simple with required params
Product: Red Hat Enterprise Linux 7 Reporter: Wayne Sun <gsun>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 7.0CC: acathrow, cwei, dyuan, mzhan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.0.4-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 916501 (view as bug list) Environment:
Last Closed: 2014-06-13 10:15:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 916501    

Description Wayne Sun 2013-02-28 07:40:52 UTC
Description of problem:
python binding API pinEmulator and emulatorPinInfo should be simple and clear as pinVcpu and vcpuPinInfo for given params to use.

# python
Python 2.7.3 (default, Aug 10 2012, 02:54:27) 
[GCC 4.7.1 20120720 (Red Hat 4.7.1-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> con = libvirt.open(None)
>>> dom = con.lookupByName('libvirt_test_api')
>>> dom.pinEmulator('sdflsjkl', 2, 0)
0

the given cpumap is a random str 'sdflsjkl' and it success
check with virsh command:
# virsh emulatorpin libvirt_test_api
emulator: CPU Affinity
----------------------------------
       *: 0-1,4-6,10,13-14

>>> dom.emulatorPinInfo(' ', 2, 0)
1

the return vaule of emulatorPinInfo will be 1 as success, user can't get detail useful info out of it.

Version-Release number of selected component (if applicable):
libvirt-1.0.2-1.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. as description
2.
3.
  
Actual results:
as description

Expected results:
should be like pinVcpu and vcpuPinInfo

Additional info:

Comment 2 Peter Krempa 2013-03-21 12:51:10 UTC
The python API for emulator pinning now mirrors the design of vcpu pinning. Added upstream with:

commit d395c81121cd997d1971149361905e4e8c917004
Author: Peter Krempa <pkrempa>
Date:   Wed Mar 20 11:43:41 2013 +0100

    python: Fix emulatorpin API bindings
    
    The addition of emulator pinning APIs didn't think of doing the right
    job with python APIs for them. The default generator produced unusable
    code for this.
    
    This patch switches to proper code as in the case of domain Vcpu pining.
    This change can be classified as a python API-breaker but in the state
    the code was before I doubt anyone was able to use it successfully.

Moving to POST.

Comment 3 Wayne Sun 2013-04-09 11:44:21 UTC
# rpm -q libvirt-python libvirt
libvirt-python-1.0.4-1.el7.x86_64
libvirt-1.0.4-1.el7.x86_64

# python
Python 2.7.3 (default, Mar 28 2013, 19:04:13) 
[GCC 4.8.0 20130307 (Red Hat 4.8.0-0.16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> con = libvirt.open(None)
>>> dom = con.lookupByName('aa')
>>> dom.emulatorPinInfo(0)
(True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True)
>>> nmap = (True, True, False, True, False, False, False, False, False, False, False, False, False, False, False, False)
>>> dom.pinEmulator(nmap, 0)
0
>>> dom.emulatorPinInfo(0)
(True, True, False, True, False, False, False, False, False, False, False, False, False, False, False, False)
>>> 

this is working as vcpu pinning now.

Comment 4 Ludek Smid 2014-06-13 10:15:29 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.