diff options
author | Guannan Ren <gren@redhat.com> | 2012-09-28 20:29:03 +0800 |
---|---|---|
committer | Guannan Ren <gren@redhat.com> | 2012-10-08 21:54:06 +0800 |
commit | 49873a855f0ede1388cea7ef37bf861e88950d61 (patch) | |
tree | c89cf3145815f048b3a4db98512470709b66a3a6 /libvirt-override-api.xml | |
parent | f0b144406d83a37e6029896a6b5ec5ee4023b39d (diff) | |
download | libvirt-python-v6-49873a855f0ede1388cea7ef37bf861e88950d61.tar.gz libvirt-python-v6-49873a855f0ede1388cea7ef37bf861e88950d61.tar.xz libvirt-python-v6-49873a855f0ede1388cea7ef37bf861e88950d61.zip |
python: keep consistent handling of Python integer conversion
libvirt_ulonglongUnwrap requires the integer type of python obj.
But libvirt_longlongUnwrap still could handle python obj of
Pyfloat_type which causes the float value to be rounded up
to an integer.
For example
>>> dom.setSchedulerParameters({'vcpu_quota': 0.88})
0
libvirt_longlongUnwrap treats 0.88 as a valid value 0
However
>>> dom.setSchedulerParameters({'cpu_shares': 1000.22})
libvirt_ulonglongUnwrap will throw out an error
"TypeError: an integer is required"
The patch make this consistent.
Diffstat (limited to 'libvirt-override-api.xml')
0 files changed, 0 insertions, 0 deletions