Hide Forgot
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:
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
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.
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.
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