Bug 701872 - libvirt-python did not catch libvirt setvcpus error of setting too many vcpus
Summary: libvirt-python did not catch libvirt setvcpus error of setting too many vcpus
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt
Version: 5.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Libvirt Maintainers
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-04 06:40 UTC by Wayne Sun
Modified: 2012-07-05 07:08 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-15 19:45:41 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Wayne Sun 2011-05-04 06:40:24 UTC
Description of problem:
When run set guest vcpu number bigger than guest max vcpu number, an error msg will be thrown out:
# virsh setvcpus rhel5 8
error: Too many virtual CPUs.

But under libvirt-python:
# python
Python 2.4.3 (#1, Dec 10 2010, 17:24:35) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> import libvirt
>>> conn = libvirt.open("")
>>> domobj  = conn.lookupByName("rhel5")
>>> domobj.setVcpus(8)
0

The return value is 0, which recoginze as success, this is not expected. 

Version-Release number of selected component (if applicable):
build: RHEL5.7-Server-20110430.2
kernel: 2.6.18-238.9.1.el5xen
packages:
libvirt-0.8.2-18.el5
libvirt-python-0.8.2-18.el5
xen-3.0.3-130.el5

How reproducible:
always

Steps to Reproduce:
1.as description
2.
3.
  
Actual results:
libvirt-python did not catch the error

Expected results:
libvirt-python can catch the error

Additional info:

Comment 1 Huming Jiang 2011-06-01 05:06:45 UTC
Could reproduce this bug on the following components of rh5.6:
kernel-xen-2.6.18-238.el5
libvirt-0.8.2-15.el5
xen-3.0.3-120.el5
libvirt-python-0.8.2-15.el5
virt-manager-0.6.1-13.el5

Steps:
# virsh setvcpus a 33
error: Too many virtual CPUs.

But under libvirt-python:
# python
Python 2.4.3 (#1, Dec 10 2010, 17:24:35) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> import libvirt
>>> conn = libvirt.open("")
>>> domobj  = conn.lookupByName("a")
>>> domobj.setVcpus(33)
0

Comment 2 RHEL Program Management 2011-06-20 22:45:00 UTC
This request was evaluated by Red Hat Product Management for inclusion in Red Hat Enterprise Linux 5.7 and Red Hat does not plan to fix this issue the currently developed update.

Contact your manager or support representative in case you need to escalate this bug.

Comment 4 RHEL Program Management 2011-08-15 19:45:41 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.

Comment 5 yuping zhang 2012-07-05 07:08:14 UTC
Test with libvirt-0.8.2-27.el5.Now libvirt-python can catch the error message.

# virsh setvcpus demo 33
error: Too many virtual CPUs.

# python
Python 2.4.3 (#1, Jun 20 2012, 20:08:35) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> conn = libvirt.open("")
>>> domobj = conn.lookupByName("demo")
>>> domobj.setVcpus(33)
libvir: QEMU error : invalid argument in requested vcpus is greater than max allowable vcpus for the domain: 33 > 16
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib64/python2.4/site-packages/libvirt.py", line 651, in setVcpus
    if ret == -1: raise libvirtError ('virDomainSetVcpus() failed', dom=self)
libvirt.libvirtError: invalid argument in requested vcpus is greater than max allowable vcpus for the domain: 33 > 16


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