Bug 1033039 - Strange response from the baselineCPU while using the python binding
Strange response from the baselineCPU while using the python binding
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
Fedora Extras Quality Assurance
Depends On:
  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-
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-12-30 20:55:58 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
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]

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

How reproducible:

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

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.

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:

Comment 2 Fedora Update System 2013-12-14 16:34:38 EST
libvirt- has been submitted as an update for Fedora 20.
Comment 3 Fedora Update System 2013-12-16 02:07:52 EST
Package libvirt-
* 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-'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 4 Fedora Update System 2013-12-30 20:55:58 EST
libvirt- 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.