Bug 1033039 - Strange response from the baselineCPU while using the python binding
Strange response from the baselineCPU while using the python binding
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
20
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-21 08:12 EST by Attila Fazekas
Modified: 2013-12-30 20:55 EST (History)
10 users (show)

See Also:
Fixed In Version: libvirt-1.1.3.2-1.fc20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-30 20:55:58 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
libvirt_test.py (1.52 KB, text/x-python)
2013-11-21 08:12 EST, Attila Fazekas
no flags Details

  None (edit)
Description Attila Fazekas 2013-11-21 08:12:02 EST
Created attachment 827177 [details]
libvirt_test.py

Description of problem:

baselineCPU method returns  with an integer (-1) while using the libvirt python binding.
In normal cases a string (xml) is the expected return type.

Version-Release number of selected component (if applicable):
rpm -qf /usr/lib64/python2.7/site-packages/libvirt.py
libvirt-python-1.1.3.1-2.fc20.x86_64

How reproducible:
always

Steps to Reproduce:

Use the attached script:
$ python ./libvirt_test.py
libvirt: CPU Driver error : internal error: CPU feature `rdtscp' specified more than once
I did not caught any exception
-1

Actual results:

The function returns back with an integer type (-1) and prints an error message to the console.

Expected results:

On error the method needs to raise an exception (or returning with None depending on what is the usual exception handling behaviour in the another parts of the library) 
The method must not rerun with an unexpected type.

According to the documentation on success virConnectBaselineCPU return with a string/xml.
http://libvirt.org/html/libvirt-libvirt.html#virConnectBaselineCPU

Additional info:
The issue seen on F20 TC2 cloud image in virtual machine after
sudo yum install libvirt-python libvirt qemu-system-x86.x86_64
sudo service libvirtd restart
python libvirt_test.py

The issue also visible while using devstack (openstack-nova).
Comment 1 Cole Robinson 2013-11-25 10:21:43 EST
Patch posted upstream:

http://www.redhat.com/archives/libvir-list/2013-November/msg00967.html
Comment 2 Fedora Update System 2013-12-14 16:34:38 EST
libvirt-1.1.3.2-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/libvirt-1.1.3.2-1.fc20
Comment 3 Fedora Update System 2013-12-16 02:07:52 EST
Package libvirt-1.1.3.2-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libvirt-1.1.3.2-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-23446/libvirt-1.1.3.2-1.fc20
then log in and leave karma (feedback).
Comment 4 Fedora Update System 2013-12-30 20:55:58 EST
libvirt-1.1.3.2-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

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