Bug 1033039 - Strange response from the baselineCPU while using the python binding
Summary: Strange response from the baselineCPU while using the python binding
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-21 13:12 UTC by Attila Fazekas
Modified: 2013-12-31 01:55 UTC (History)
10 users (show)

Fixed In Version: libvirt-1.1.3.2-1.fc20
Clone Of:
Environment:
Last Closed: 2013-12-31 01:55:58 UTC
Type: Bug
Embargoed:


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

Description Attila Fazekas 2013-11-21 13:12:02 UTC
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 15:21:43 UTC
Patch posted upstream:

http://www.redhat.com/archives/libvir-list/2013-November/msg00967.html

Comment 2 Fedora Update System 2013-12-14 21:34:38 UTC
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 07:07:52 UTC
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-31 01:55:58 UTC
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.