[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [python-PATCH] Fix libvirt_longlongWrap returning a very large value



On 11.08.2014 14:59, Wang Rui wrote:
From: Zhou Yimin <zhouyimin huawei com>

If hypervisor is not Xen, the errs in struct _virDomainBlockStats will be -1.
But in KVM when we call domain.blockStats(), errs is 18446744073709551615.

To fix that, this patch has two changes:
1. Replace use of the PyLong_FromUnsignedLongLong with PyLong_FromLongLong
    in function libvirt_longlongWrap
2. If the paramemter of libvirt_longlongWrap is unsigned long long,
    use libvirt_ulonglongWrap instead because of above change.

After this patch, errs is -1 which is consistent with virDomainBlockStats api.

Signed-off-by: Zhou Yimin <zhouyimin huawei com>
Signed-off-by: Wang Rui <moon wangrui huawei com>
---
  libvirt-override.c | 18 +++++++++---------
  typewrappers.c     |  2 +-
  2 files changed, 10 insertions(+), 10 deletions(-)

ACKed & pushed. Congratulations on your first libvirt-python commit!

Michal


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]